From aa3666f12c86a90c8a536867f0a2a44a6528bd7f Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 1 May 2017 17:26:31 +0200 Subject: sensor-applet.c: replace deprecated GtkMisc --- sensors-applet/sensors-applet.c | 22 ++++++++++++++++++---- 1 file 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) { -- cgit v1.2.1