[gnome-control-center] keyboard: Replace g_object_new with gtk widget methods



commit e09e53a8c236c1836640b3112581fcdd7445f336
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Sep 25 16:26:17 2020 +1200

    keyboard: Replace g_object_new with gtk widget methods
    
    This improves compile time type checking.

 panels/keyboard/cc-keyboard-panel.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c
index eaf1569c4..f424c2b38 100644
--- a/panels/keyboard/cc-keyboard-panel.c
+++ b/panels/keyboard/cc-keyboard-panel.c
@@ -423,12 +423,10 @@ header_function (GtkListBoxRow *row,
       gtk_widget_set_margin_top (box, before ? 18 : 6);
 
       markup = g_strdup_printf ("<b>%s</b>", _(data->section_title));
-      label = g_object_new (GTK_TYPE_LABEL,
-                            "label", markup,
-                            "use-markup", TRUE,
-                            "xalign", 0.0,
-                            "margin-start", 6,
-                            NULL);
+      label = gtk_label_new (NULL);
+      gtk_label_set_markup (GTK_LABEL (label), markup);
+      gtk_label_set_xalign (GTK_LABEL (label), 0.0);
+      gtk_widget_set_margin_start (label, 6);
       gtk_widget_show (label);
       gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
       gtk_container_add (GTK_CONTAINER (box), label);


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