[libgnomekbd: 4/6] Drop deprecated GtkAlignment, apply properties directly to the label




commit ea7798dac4747434eb685289a9aa6869daac0c56
Author: Daniel Kahn Gillmor <dkg fifthhorseman net>
Date:   Fri Apr 8 12:27:14 2022 -0700

    Drop deprecated GtkAlignment, apply properties directly to the label

 libgnomekbd/gkbd-indicator.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/libgnomekbd/gkbd-indicator.c b/libgnomekbd/gkbd-indicator.c
index a3afdf3..1383cdc 100644
--- a/libgnomekbd/gkbd-indicator.c
+++ b/libgnomekbd/gkbd-indicator.c
@@ -208,7 +208,7 @@ gkbd_indicator_prepare_drawing (GkbdIndicator * gki, int group)
        } else {
                char *lbl_title = NULL;
                char *layout_name = NULL;
-               GtkWidget *align, *label;
+               GtkWidget *label;
                static GHashTable *ln2cnt_map = NULL;
 
                layout_name =
@@ -220,8 +220,12 @@ gkbd_indicator_prepare_drawing (GkbdIndicator * gki, int group)
                                                           &ln2cnt_map,
                                                           layout_name);
 
-               align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
                label = gtk_label_new (lbl_title);
+                gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
+                gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+                gtk_widget_set_hexpand (label, TRUE);
+                gtk_widget_set_vexpand (label, TRUE);
+                
                g_free (lbl_title);
                gtk_label_set_angle (GTK_LABEL (label), gki->priv->angle);
 
@@ -232,10 +236,9 @@ gkbd_indicator_prepare_drawing (GkbdIndicator * gki, int group)
                        ln2cnt_map = NULL;
                }
 
-               gtk_container_add (GTK_CONTAINER (align), label);
-               gtk_container_add (GTK_CONTAINER (ebox), align);
+               gtk_container_add (GTK_CONTAINER (ebox), label);
 
-               gtk_container_set_border_width (GTK_CONTAINER (align), 2);
+               gtk_container_set_border_width (GTK_CONTAINER (label), 2);
        }
 
        g_signal_connect (G_OBJECT (ebox),


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