[gtk/menu-section-title: 72/73] Change the approach to menu section titles



commit 654af88529a692f2d14fb288a1c0081c8b809db7
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Apr 21 14:48:39 2020 -0400

    Change the approach to menu section titles
    
    Put the label below the separator, and give
    it the title style class.

 gtk/gtkmenusectionbox.c | 11 ++++-------
 1 file 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
     {


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