diff options
author | Timm Bäder <mail@baedert.org> | 2015-05-01 19:32:29 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2015-05-25 13:00:34 +0200 |
commit | 375efee6bf8f2165f24e7d745161a2e6302178af (patch) | |
tree | 564924e2df252fbbf88c212f8386465ac099b733 | |
parent | 1ea75bf8fbd4c19eea0f3b880b7c73d0432d91c9 (diff) | |
download | gtk+-375efee6bf8f2165f24e7d745161a2e6302178af.tar.gz |
Revert "popover: Expand buttons over entire width"
This reverts commit e23fa3e61da773dc407f48ec02787b3318975aff.
-rw-r--r-- | gtk/gtkmenusectionbox.c | 30 | ||||
-rw-r--r-- | gtk/gtkmodelbutton.c | 13 | ||||
-rw-r--r-- | gtk/theme/Adwaita/gtk-contained.css | 6 |
3 files changed, 20 insertions, 29 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 6bd117a9d0..b152491b7a 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -405,10 +405,7 @@ gtk_menu_section_box_new_toplevel (GtkStack *stack, { GtkMenuSectionBox *box; - box = g_object_new (GTK_TYPE_MENU_SECTION_BOX, - "margin-top", 12, - "margin-bottom", 12, - NULL); + box = g_object_new (GTK_TYPE_MENU_SECTION_BOX, "margin", 10, NULL); gtk_stack_add_named (stack, GTK_WIDGET (box), "main"); box->tracker = gtk_menu_tracker_new (GTK_ACTION_OBSERVABLE (_gtk_widget_get_action_muxer (GTK_WIDGET (box), TRUE)), @@ -431,10 +428,7 @@ gtk_menu_section_box_new_submenu (GtkMenuTrackerItem *item, GtkMenuSectionBox *box; GtkWidget *button; - box = g_object_new (GTK_TYPE_MENU_SECTION_BOX, - "margin-top", 12, - "margin-bottom", 12, - NULL); + box = g_object_new (GTK_TYPE_MENU_SECTION_BOX, "margin", 10, NULL); button = g_object_new (GTK_TYPE_MODEL_BUTTON, "menu-name", name, @@ -486,8 +480,6 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item, gtk_orientable_set_orientation (GTK_ORIENTABLE (box->item_box), GTK_ORIENTATION_HORIZONTAL); gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (box->item_box)), GTK_STYLE_CLASS_LINKED); box->iconic = TRUE; - gtk_widget_set_margin_start (GTK_WIDGET (box->item_box), 12); - gtk_widget_set_margin_end (GTK_WIDGET (box->item_box), 12); } if (label != NULL) @@ -502,6 +494,12 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item, box->separator = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); g_object_ref_sink (box->separator); + g_object_set (box->separator, + "margin-start", 12, + "margin-end", 12, + "margin-top", 6, + "margin-bottom", 3, + NULL); gtk_container_add (GTK_CONTAINER (box->separator), title); gtk_container_add (GTK_CONTAINER (box->separator), separator); gtk_widget_show_all (box->separator); @@ -511,14 +509,14 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item, box->separator = separator; g_object_ref_sink (box->separator); + g_object_set (box->separator, + "margin-start", 12, + "margin-end", 12, + "margin-top", 3, + "margin-bottom", 3, + NULL); gtk_widget_show (box->separator); } - g_object_set (box->separator, - "margin-top", 4, - "margin-bottom", 4, - NULL); - - box->tracker = gtk_menu_tracker_new_for_item_link (item, G_MENU_LINK_SECTION, FALSE, FALSE, gtk_menu_section_box_insert_func, gtk_menu_section_box_remove_func, diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c index 6a16b00ba3..94bb778db1 100644 --- a/gtk/gtkmodelbutton.c +++ b/gtk/gtkmodelbutton.c @@ -35,8 +35,6 @@ #include "gtkpopover.h" #include "gtkintl.h" -#define INDICATOR_MARGIN 24 - /** * SECTION:gtkmodelbutton * @Short_description: A button that uses a GAction as model @@ -295,7 +293,6 @@ gtk_model_button_set_iconic (GtkModelButton *button, gtk_style_context_remove_class (context, GTK_STYLE_CLASS_MENUITEM); gtk_style_context_add_class (context, "image-button"); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NORMAL); - g_object_set (G_OBJECT (button->box), "margin", 4, NULL); } else { @@ -725,7 +722,7 @@ gtk_model_button_draw (GtkWidget *widget, gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &indicator_size, NULL); indicator_spacing = indicator_size / 8; - x = width - border_width - INDICATOR_MARGIN - indicator_size; + x = width - border_width - indicator_spacing - indicator_size; if (indicator_is_left (widget)) x = width - (indicator_size + x); @@ -971,10 +968,10 @@ gtk_model_button_init (GtkModelButton *button) { gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); button->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - gtk_widget_set_margin_start (button->box, 24); - gtk_widget_set_margin_end (button->box, 24); - gtk_widget_set_margin_top (button->box, 4); - gtk_widget_set_margin_bottom (button->box, 4); + gtk_widget_set_margin_start (button->box, 12); + gtk_widget_set_margin_end (button->box, 12); + gtk_widget_set_margin_top (button->box, 3); + gtk_widget_set_margin_bottom (button->box, 3); gtk_widget_set_halign (button->box, GTK_ALIGN_FILL); gtk_widget_show (button->box); button->image = gtk_image_new (); diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css index 071e7103a2..8074dc99c7 100644 --- a/gtk/theme/Adwaita/gtk-contained.css +++ b/gtk/theme/Adwaita/gtk-contained.css @@ -2057,12 +2057,8 @@ column-header .titlebar .button.titlebutton, /*************** * Popovers * ***************/ - -.popover .menuitem.button { - border-radius: 0px; -} - .popover { + padding: 2px; border: 1px solid #a1a1a1; border-radius: 5px; background-color: #f6f6f6; |