diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-21 14:48:39 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-21 14:48:39 -0400 |
commit | 654af88529a692f2d14fb288a1c0081c8b809db7 (patch) | |
tree | 98095c7ffa3c9c4089e42d6fd672c977d2c75f8b /gtk/gtkmenusectionbox.c | |
parent | e818bf85145d036bd6143d42da6c4fb6934559d1 (diff) | |
download | gtk+-654af88529a692f2d14fb288a1c0081c8b809db7.tar.gz |
Change the approach to menu section titles
Put the label below the separator, and give
it the title style class.
Diffstat (limited to 'gtk/gtkmenusectionbox.c')
-rw-r--r-- | gtk/gtkmenusectionbox.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gtk/gtkmenusectionbox.c b/gtk/gtkmenusectionbox.c index 7933f81dfa..413789a274 100644 --- a/gtk/gtkmenusectionbox.c +++ b/gtk/gtkmenusectionbox.c @@ -612,24 +612,21 @@ gtk_menu_section_box_new_section (GtkMenuTrackerItem *item, GtkWidget *separator; GtkWidget *title; - box->separator = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); + box->separator = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); g_object_ref_sink (box->separator); separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_set_valign (separator, GTK_ALIGN_CENTER); + gtk_widget_set_hexpand (separator, TRUE); gtk_container_add (GTK_CONTAINER (box->separator), separator); - gtk_size_group_add_widget (box->indicators, separator); title = gtk_label_new (label); g_object_bind_property (item, "label", title, "label", G_BINDING_SYNC_CREATE); gtk_widget_add_css_class (title, GTK_STYLE_CLASS_SEPARATOR); gtk_widget_set_halign (title, GTK_ALIGN_START); + gtk_label_set_xalign (GTK_LABEL (title), 0.0); + gtk_widget_add_css_class (title, GTK_STYLE_CLASS_TITLE); gtk_container_add (GTK_CONTAINER (box->separator), title); - - separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_widget_set_valign (separator, GTK_ALIGN_CENTER); - gtk_widget_set_hexpand (separator, TRUE); - gtk_container_add (GTK_CONTAINER (box->separator), separator); } else { |