[anjuta] git: Give reasonable default size to git dock



commit 4bb28c09646c6e5dad069a94859c689c5a6b52c5
Author: Johannes Schmid <jhs gnome org>
Date:   Tue Apr 15 16:59:55 2014 +0200

    git: Give reasonable default size to git dock

 libanjuta/anjuta-command-bar.c |    8 ++++----
 plugins/git/plugin.c           |   24 ++++++++++++------------
 plugins/git/plugin.h           |    2 +-
 3 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/libanjuta/anjuta-command-bar.c b/libanjuta/anjuta-command-bar.c
index 8048b3d..96c100a 100644
--- a/libanjuta/anjuta-command-bar.c
+++ b/libanjuta/anjuta-command-bar.c
@@ -205,8 +205,8 @@ anjuta_command_bar_add_action_group (AnjutaCommandBar *self,
                        
                        gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
                        button_label = gtk_bin_get_child (GTK_BIN (button));
-                       gtk_label_set_width_chars (GTK_LABEL (button_label), self->priv->max_text_width);
-                       gtk_label_set_line_wrap (GTK_LABEL (button_label), TRUE);
+                       gtk_label_set_max_width_chars (GTK_LABEL (button_label), self->priv->max_text_width);
+                       gtk_label_set_ellipsize (GTK_LABEL (button_label), PANGO_ELLIPSIZE_END);
 
                        /* Left-align button contents */
                        gtk_misc_set_alignment (GTK_MISC (button_label), 0.0, 0.5);
@@ -262,8 +262,8 @@ anjuta_command_bar_add_action_group (AnjutaCommandBar *self,
                }
        }
 
-       gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
-                                              vbox);
+       gtk_container_add (GTK_CONTAINER (scrolled_window),
+                          vbox);
        gtk_widget_show_all (scrolled_window);
        gtk_notebook_append_page (GTK_NOTEBOOK (self), scrolled_window, NULL);
 }
diff --git a/plugins/git/plugin.c b/plugins/git/plugin.c
index 3a00448..6ed9dd6 100644
--- a/plugins/git/plugin.c
+++ b/plugins/git/plugin.c
@@ -58,6 +58,7 @@
 
 #define SETTINGS_SCHEMA "org.gnome.anjuta.plugins.git"
 #define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-git.xml"
+#define MIN_DOCK_WIDTH 650
 
 AnjutaCommandBarEntry branch_entries[] =
 {
@@ -801,7 +802,7 @@ git_activate_plugin (AnjutaPlugin *plugin)
        gchar *objects[] = {"grip_box",
                                                NULL};
        GtkWidget *git_tasks_button;
-       GtkWidget *scrolled_window, *viewport;
+       GtkWidget *scrolled_window;
        AnjutaUI *ui;
        
        DEBUG_PRINT ("%s", "Git: Activating Git plugin …");
@@ -815,24 +816,23 @@ git_activate_plugin (AnjutaPlugin *plugin)
        
        /* Command bar and dock */
        git_plugin->command_bar = anjuta_command_bar_new ();
+
        git_plugin->dock = anjuta_dock_new ();
-       viewport = gtk_viewport_new (NULL, NULL);
        scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+       gtk_widget_set_size_request (scrolled_window, MIN_DOCK_WIDTH, -1);
 
-       gtk_container_add (GTK_CONTAINER (viewport), git_plugin->dock);
-       gtk_container_add (GTK_CONTAINER (scrolled_window), viewport);
-
-       git_plugin->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
-       gtk_box_pack_start (GTK_BOX (git_plugin->box), scrolled_window, TRUE, TRUE, 0);
-       gtk_box_pack_start (GTK_BOX (git_plugin->box), git_plugin->command_bar, FALSE, FALSE, 0);
+       gtk_container_add (GTK_CONTAINER (scrolled_window), git_plugin->dock);
+       
+       git_plugin->paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
+       gtk_paned_add1 (GTK_PANED (git_plugin->paned), scrolled_window);
+       gtk_paned_add2 (GTK_PANED (git_plugin->paned), git_plugin->command_bar);
        
 
        anjuta_dock_set_command_bar (ANJUTA_DOCK (git_plugin->dock), 
                                     ANJUTA_COMMAND_BAR (git_plugin->command_bar));
 
-       gtk_widget_show (git_plugin->box);
-       gtk_widget_show_all (scrolled_window);
-       anjuta_shell_add_widget_custom (plugin->shell, git_plugin->box, "GitDock", 
+       gtk_widget_show_all (git_plugin->paned);
+       anjuta_shell_add_widget_custom (plugin->shell, git_plugin->paned, "GitDock", 
                                                _("Git"), "git-plugin", 
                                        GTK_WIDGET (gtk_builder_get_object (builder, "grip_box")), 
                                        ANJUTA_SHELL_PLACEMENT_CENTER,
@@ -1003,7 +1003,7 @@ git_deactivate_plugin (AnjutaPlugin *plugin)
        anjuta_plugin_remove_watch (plugin, git_plugin->editor_watch_id,
                                                                TRUE);
 
-       anjuta_shell_remove_widget (plugin->shell, git_plugin->box, NULL);
+       anjuta_shell_remove_widget (plugin->shell, git_plugin->paned, NULL);
 
        ui = anjuta_shell_get_ui (plugin->shell, NULL);
        anjuta_ui_remove_action_group (ui, git_plugin->status_menu_group);
diff --git a/plugins/git/plugin.h b/plugins/git/plugin.h
index fc639d8..e322f24 100644
--- a/plugins/git/plugin.h
+++ b/plugins/git/plugin.h
@@ -65,7 +65,7 @@ struct _Git
 
        GtkWidget *command_bar;
        GtkWidget *dock;
-       GtkWidget *box;
+       GtkWidget *paned;
 
        GSettings *settings;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]