diff options
author | raveit65 <[email protected]> | 2017-05-01 17:26:31 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-05-01 17:42:59 +0200 |
commit | aa3666f12c86a90c8a536867f0a2a44a6528bd7f (patch) | |
tree | 853862bb54d9f29fa56966b24f0a63adbe9d322b /sensors-applet/sensors-applet.c | |
parent | ca9ef4c9ebcd9f24ee5e8819a7e7214f01df1ac4 (diff) | |
download | mate-sensors-applet-aa3666f12c86a90c8a536867f0a2a44a6528bd7f.tar.bz2 mate-sensors-applet-aa3666f12c86a90c8a536867f0a2a44a6528bd7f.tar.xz |
sensor-applet.c: replace deprecated GtkMisc
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r-- | sensors-applet/sensors-applet.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c index 557653c..48a03ff 100644 --- a/sensors-applet/sensors-applet.c +++ b/sensors-applet/sensors-applet.c @@ -728,13 +728,20 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) { if (layout_mode == VALUE_BESIDE_LABEL) { /* left align labels */ if (((ActiveSensor *)(current_sensor->data))->icon) { - gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->icon), 0.0, 0.5); + gtk_widget_set_halign (((ActiveSensor *)(current_sensor->data))->icon, GTK_ALIGN_START); + gtk_widget_set_valign (((ActiveSensor *)(current_sensor->data))->icon, GTK_ALIGN_CENTER); } if (((ActiveSensor *)(current_sensor->data))->label) { +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL(((ActiveSensor *)(current_sensor->data))->label), 0); + gtk_label_set_yalign (GTK_LABEL(((ActiveSensor *)(current_sensor->data))->label), 0.5); +#else gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->label), 0.0, 0.5); +#endif } if (((ActiveSensor *)(current_sensor->data))->value) { - gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->value), 0.0, 0.5); + gtk_widget_set_halign (((ActiveSensor *)(current_sensor->data))->value, GTK_ALIGN_START); + gtk_widget_set_valign (((ActiveSensor *)(current_sensor->data))->value, GTK_ALIGN_CENTER); } /* place value next to label */ @@ -748,13 +755,20 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) { /* center align labels */ if (((ActiveSensor *)(current_sensor->data))->icon) { - gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->icon), 0.5, 0.5); + gtk_widget_set_halign (((ActiveSensor *)(current_sensor->data))->icon, GTK_ALIGN_CENTER); + gtk_widget_set_valign (((ActiveSensor *)(current_sensor->data))->icon, GTK_ALIGN_CENTER); } if (((ActiveSensor *)(current_sensor->data))->label) { +#if GTK_CHECK_VERSION (3, 16, 0) + gtk_label_set_xalign (GTK_LABEL(((ActiveSensor *)(current_sensor->data))->label), 0.5); + gtk_label_set_yalign (GTK_LABEL(((ActiveSensor *)(current_sensor->data))->label), 0.5); +#else gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->label), 0.5, 0.5); +#endif } if (((ActiveSensor *)(current_sensor->data))->value) { - gtk_misc_set_alignment(GTK_MISC(((ActiveSensor *)(current_sensor->data))->value), 0.5, 0.5); + gtk_widget_set_halign (((ActiveSensor *)(current_sensor->data))->value, GTK_ALIGN_CENTER); + gtk_widget_set_valign (((ActiveSensor *)(current_sensor->data))->value, GTK_ALIGN_CENTER); } if (((ActiveSensor *)(current_sensor->data))->value) { |