[gtk+/wip/otte/gtk4: 43/127] Don't use GtkBox's center child in a few places



commit 22640110751de84d3a23263a92786a7dabcf6379
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 2 08:43:30 2016 +0200

    Don't use GtkBox's center child in a few places
    
    We can as well use a normal child and let it hexpand.

 gtk/gtkmessagedialog.c    |    4 +++-
 gtk/gtkshortcutssection.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index e70c820..36a9d6f 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -452,8 +452,10 @@ gtk_message_dialog_constructed (GObject *object)
       gtk_widget_set_no_show_all (label, TRUE);
       gtk_widget_set_margin_top (label, 6);
       gtk_widget_set_margin_bottom (label, 6);
+      gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
+      gtk_widget_set_hexpand (label, TRUE);
       gtk_style_context_add_class (gtk_widget_get_style_context (label), "title");
-      gtk_box_set_center_widget (GTK_BOX (box), label);
+      gtk_container_add (GTK_CONTAINER (box), label);
       g_signal_connect_object (dialog, "notify::title", G_CALLBACK (update_title), label, 0);
 
       gtk_window_set_titlebar (GTK_WINDOW (dialog), box);
diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c
index e02a52d..f23b0c1 100644
--- a/gtk/gtkshortcutssection.c
+++ b/gtk/gtkshortcutssection.c
@@ -455,7 +455,9 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self)
   self->footer = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 20);
   GTK_CONTAINER_CLASS (gtk_shortcuts_section_parent_class)->add (GTK_CONTAINER (self), self->footer);
 
-  gtk_box_set_center_widget (GTK_BOX (self->footer), GTK_WIDGET (self->switcher));
+  gtk_widget_set_hexpand (GTK_WIDGET (self->switcher), TRUE);
+  gtk_widget_set_halign (GTK_WIDGET (self->switcher), GTK_ALIGN_CENTER);
+  gtk_container_add (GTK_CONTAINER (self->footer), GTK_WIDGET (self->switcher));
   gtk_box_pack_end (GTK_BOX (self->footer), self->show_all, TRUE, TRUE, 0);
   gtk_widget_set_halign (self->show_all, GTK_ALIGN_END);
 


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