[anjuta] Alter styling and position of "show all plugins" checkbox



commit cfef99fd3c6cdef63807305d3a3c587183e51716
Author: Christian Hergert <chris dronelabs com>
Date:   Thu Mar 24 20:07:48 2011 -0700

    Alter styling and position of "show all plugins" checkbox
    
    The checkbox to show all Anjuta plugins previously was placed at
    the top of the notebook page. This detracted from what the user is
    trying to do and can steal users eye focus. Additionally, the amount
    of padding allocated for said checkbox stole valuable vertical space
    from the plugin list.
    
    This changeset borrows design from the keyboard shortcut list in
    the gnome-control-center. It uses a toolbar at the bottom of the
    treeview that looks attached to the treeview. The checkbox is placed
    within a toolitem in the toolbar.
    
    This saves valuable vertical space and allows the user to more easily
    focus on the plugin list.
    
    Signed-off-by: Christian Hergert <chris dronelabs com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645659

 libanjuta/anjuta-plugin-manager.c |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/libanjuta/anjuta-plugin-manager.c b/libanjuta/anjuta-plugin-manager.c
index 003d78c..c8d67b4 100644
--- a/libanjuta/anjuta-plugin-manager.c
+++ b/libanjuta/anjuta-plugin-manager.c
@@ -1146,24 +1146,37 @@ anjuta_plugin_manager_get_plugins_page (AnjutaPluginManager *plugin_manager)
 	GtkWidget *checkbutton;
 	GtkWidget *tree;
 	GtkWidget *scrolled;
+	GtkWidget *toolbar;
+	GtkWidget *toolitem;
 	GtkListStore *store;
 	
 	/* Plugins page */
 	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
-	
-	checkbutton = gtk_check_button_new_with_label (dgettext (GETTEXT_PACKAGE, "Only show user activatable plugins"));
-	gtk_container_set_border_width (GTK_CONTAINER (checkbutton), 10);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), TRUE);
-	gtk_box_pack_start (GTK_BOX (vbox), checkbutton, FALSE, FALSE, 0);
-	
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+
 	scrolled = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
 									     GTK_SHADOW_IN);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
 									GTK_POLICY_NEVER,
 									GTK_POLICY_AUTOMATIC);
+	gtk_style_context_set_junction_sides (gtk_widget_get_style_context (scrolled), GTK_JUNCTION_BOTTOM);
 	gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0);
+
+	toolbar = gtk_toolbar_new ();
+	gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), "inline-toolbar");
+	gtk_style_context_set_junction_sides (gtk_widget_get_style_context (toolbar), GTK_JUNCTION_TOP);
+	gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, FALSE, 0);
+	gtk_widget_show (toolbar);
+
+	toolitem = gtk_tool_item_new ();
+	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (toolitem), 0);
+	gtk_widget_show (toolitem);
+
+	checkbutton = gtk_check_button_new_with_label (dgettext (GETTEXT_PACKAGE, "Only show user activatable plugins"));
+	gtk_style_context_add_class(gtk_widget_get_style_context(checkbutton), "inline-toolbar");
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), TRUE);
+	gtk_container_add (GTK_CONTAINER (toolitem), checkbutton);
 	
 	tree = create_plugin_tree ();
 	gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree), TRUE);



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