[gnome-applets] cpufreq: avoid deprecated GtkAlignment
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] cpufreq: avoid deprecated GtkAlignment
- Date: Tue, 10 Mar 2020 13:34:03 +0000 (UTC)
commit 66e58e774e20aa101d35c01f9e79746eca3a968c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Mar 10 14:36:47 2020 +0200
cpufreq: avoid deprecated GtkAlignment
cpufreq/src/cpufreq-applet.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index c02aea133..f305c3cb4 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -53,7 +53,6 @@ struct _CPUFreqApplet {
PanelAppletOrient orient;
gint size;
- GtkWidget *container;
GtkWidget *box;
GtkWidget *icon;
GtkWidget *labels_box;
@@ -193,24 +192,22 @@ cpufreq_applet_init (CPUFreqApplet *applet)
applet->orient = panel_applet_get_orient (PANEL_APPLET (applet));
+ applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, SPACING);
+ gtk_container_add (GTK_CONTAINER (applet), applet->box);
+ gtk_widget_set_valign (applet->box, GTK_ALIGN_CENTER);
+ gtk_widget_show (applet->box);
+
switch (applet->orient) {
case PANEL_APPLET_ORIENT_LEFT:
case PANEL_APPLET_ORIENT_RIGHT:
- applet->container = gtk_alignment_new (0.5, 0.5, 0, 0);
+ gtk_widget_set_halign (applet->box, GTK_ALIGN_CENTER);
break;
case PANEL_APPLET_ORIENT_UP:
case PANEL_APPLET_ORIENT_DOWN:
- applet->container = gtk_alignment_new (0, 0.5, 0, 0);
+ gtk_widget_set_halign (applet->box, GTK_ALIGN_START);
break;
}
- gtk_container_add (GTK_CONTAINER (applet), applet->container);
- gtk_widget_show (applet->container);
-
- applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, SPACING);
- gtk_container_add (GTK_CONTAINER (applet->container), applet->box);
- gtk_widget_show (applet->box);
-
applet->icon = gtk_image_new ();
gtk_box_pack_start (GTK_BOX (applet->box), applet->icon, FALSE, FALSE, 0);
@@ -602,12 +599,10 @@ cpufreq_applet_change_orient (PanelApplet *pa, PanelAppletOrient orient)
if ((orient == PANEL_APPLET_ORIENT_LEFT) ||
(orient == PANEL_APPLET_ORIENT_RIGHT)) {
size = allocation.width;
- gtk_alignment_set (GTK_ALIGNMENT (applet->container),
- 0.5, 0.5, 0, 0);
+ gtk_widget_set_halign (applet->box, GTK_ALIGN_CENTER);
} else {
size = allocation.height;
- gtk_alignment_set (GTK_ALIGNMENT (applet->container),
- 0, 0.5, 0, 0);
+ gtk_widget_set_halign (applet->box, GTK_ALIGN_START);
}
if (size != applet->size) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]