summaryrefslogtreecommitdiff
path: root/sensors-applet/sensors-applet.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-23 21:46:17 +0300
committermonsta <[email protected]>2016-11-23 21:46:17 +0300
commit5ec8b38b3706e5014316d17ddbf46b64e4bafc9b (patch)
treef75c33455aed0ce4cb6dc76e9dbfc81556d86028 /sensors-applet/sensors-applet.c
parent6bbbccfde430a26b4d288a97117c87c622986f69 (diff)
downloadmate-sensors-applet-5ec8b38b3706e5014316d17ddbf46b64e4bafc9b.tar.bz2
mate-sensors-applet-5ec8b38b3706e5014316d17ddbf46b64e4bafc9b.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r--sensors-applet/sensors-applet.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c
index b4f58cc..7ee04c7 100644
--- a/sensors-applet/sensors-applet.c
+++ b/sensors-applet/sensors-applet.c
@@ -50,9 +50,6 @@
* real value is stored */
#define COLUMN_SPACING 2
#define ROW_SPACING 1
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_widget_size_request(X,Y) gtk_widget_get_preferred_size(X,Y,NULL)
-#endif
/* callbacks for panel menu */
static void prefs_cb(GtkAction *action,
@@ -525,8 +522,8 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
switch (display_mode) {
case DISPLAY_VALUE:
- gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->value),
+ &req, NULL);
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
@@ -548,14 +545,14 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
/* even though we end up packing the event boxes into the
* panel, these dont give back request sizes, so need to ask
* widgets directly */
- gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->value),
+ &req, NULL);
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
- gtk_widget_size_request(GTK_WIDGET(first_sensor->label),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->label),
+ &req, NULL);
label_width = req.width + COLUMN_SPACING;
label_height = req.height + ROW_SPACING;
@@ -586,13 +583,13 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
break;
case DISPLAY_ICON_WITH_VALUE:
- gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->value),
+ &req, NULL);
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
- gtk_widget_size_request(GTK_WIDGET(first_sensor->icon),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->icon),
+ &req, NULL);
icon_width = req.width + COLUMN_SPACING;
icon_height = req.height + ROW_SPACING;
@@ -618,8 +615,8 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
break;
case DISPLAY_ICON:
- gtk_widget_size_request(GTK_WIDGET(first_sensor->icon),
- &req);
+ gtk_widget_get_preferred_size(GTK_WIDGET(first_sensor->icon),
+ &req, NULL);
icon_width = req.width + COLUMN_SPACING;
icon_height = req.height + ROW_SPACING;