summaryrefslogtreecommitdiff
path: root/sensors-applet/sensors-applet.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-06-09 11:15:17 +0300
committermonsta <[email protected]>2015-06-09 11:15:17 +0300
commit4be997ac697e3217ba4ee033b419aed50f02f4d6 (patch)
tree47d434af81a085cc33291df6d641d43a079cb7a2 /sensors-applet/sensors-applet.c
parentda5d0ca71f9a94e1aa0cef3be6a717aaadb7f380 (diff)
parent22f0f60d2f7e8290aec0c8fe0d2667123430d746 (diff)
downloadmate-sensors-applet-4be997ac697e3217ba4ee033b419aed50f02f4d6.tar.bz2
mate-sensors-applet-4be997ac697e3217ba4ee033b419aed50f02f4d6.tar.xz
Merge pull request #25 from NiceandGently/master
Gtk3: fix non displaying sensors in panel with gtk3 build
Diffstat (limited to 'sensors-applet/sensors-applet.c')
-rw-r--r--sensors-applet/sensors-applet.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c
index 7236591..3081163 100644
--- a/sensors-applet/sensors-applet.c
+++ b/sensors-applet/sensors-applet.c
@@ -549,8 +549,14 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
case DISPLAY_VALUE:
gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
&req);
+/* FIXME, this can be done better somewhere for cairo */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ value_width = req.width + COLUMN_SPACING + 10;
+ value_height = req.height + ROW_SPACING + 10;
+#else
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
+#endif
/* make sure all widths and heights are non zero,
* otherwise will get a divide by zero exception below
@@ -572,6 +578,16 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
* widgets directly */
gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
&req);
+/* FIXME, this can be done better somewhere for cairo */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ value_width = req.width + COLUMN_SPACING + 10;
+ value_height = req.height + ROW_SPACING + 10;
+
+ gtk_widget_size_request(GTK_WIDGET(first_sensor->label),
+ &req);
+ label_width = req.width + COLUMN_SPACING + 10;
+ label_height = req.height + ROW_SPACING + 10;
+#else
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
@@ -579,6 +595,7 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
&req);
label_width = req.width + COLUMN_SPACING;
label_height = req.height + ROW_SPACING;
+#endif
/* make sure all widths and heights are non zero, otherwise
* will get a divide by zero exception below
@@ -609,6 +626,16 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
case DISPLAY_ICON_WITH_VALUE:
gtk_widget_size_request(GTK_WIDGET(first_sensor->value),
&req);
+/* FIXME, this can be done better somewhere for cairo */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ value_width = req.width + COLUMN_SPACING +10;
+ value_height = req.height + ROW_SPACING + 10;
+
+ gtk_widget_size_request(GTK_WIDGET(first_sensor->icon),
+ &req);
+ icon_width = req.width + COLUMN_SPACING + 10;
+ icon_height = req.height + ROW_SPACING + 10;
+#else
value_width = req.width + COLUMN_SPACING;
value_height = req.height + ROW_SPACING;
@@ -616,6 +643,7 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
&req);
icon_width = req.width + COLUMN_SPACING;
icon_height = req.height + ROW_SPACING;
+#endif
if (!(icon_width && icon_height &&
value_width && value_height)) {
@@ -641,8 +669,14 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
case DISPLAY_ICON:
gtk_widget_size_request(GTK_WIDGET(first_sensor->icon),
&req);
+/* FIXME, this can be done better somewhere for cairo */
+#if GTK_CHECK_VERSION (3, 0, 0)
+ icon_width = req.width + COLUMN_SPACING + 10;
+ icon_height = req.height + ROW_SPACING + 10;
+#else
icon_width = req.width + COLUMN_SPACING;
icon_height = req.height + ROW_SPACING;
+#endif
if (!(icon_width && icon_height)) {
return;
}