summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2015-10-15 00:49:07 -0400
committerraveit65 <[email protected]>2015-10-16 16:19:10 +0200
commitec37a4ececaecd61794913469b82a301919f8a08 (patch)
tree3740669054424aa861618f410c96e89534fe9aa4
parent167c7c5652cc62e3346f5238e15acb3b4b0bcf9b (diff)
downloadmate-applets-ec37a4ececaecd61794913469b82a301919f8a08.tar.bz2
mate-applets-ec37a4ececaecd61794913469b82a301919f8a08.tar.xz
GTK3 cpufreq:fix bottom panel render & 0px labels
fix bottom panel rendering of popup menu in gtk3 builds, fix zero-width frequency/percentage labels in gtk3 builds.
-rw-r--r--cpufreq/src/cpufreq-applet.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index 784d5512..3596dadd 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -433,16 +433,30 @@ cpufreq_applet_size_request (GtkWidget *widget, GtkRequisition *requisition)
applet->orient == MATE_PANEL_APPLET_ORIENT_RIGHT)
return;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /*Specify numerical values so labels in gtk3 don't get zero width */
if (applet->show_freq) {
- labels_width += cpufreq_applet_get_max_label_width (applet) + 2;
+ labels_width += 50;
}
if (applet->show_perc) {
- labels_width += cpufreq_applet_get_max_perc_width (applet);
+ labels_width += 50;
}
if (applet->show_unit) {
+ labels_width += 20;
+#else
+ if (applet->show_freq) {
+ labels_width += cpufreq_applet_get_max_label_width (applet) + 2;
+ }
+
+ if (applet->show_perc) {
+ labels_width += cpufreq_applet_get_max_perc_width (applet);
+ }
+
+ if (applet->show_unit) {
labels_width += cpufreq_applet_get_max_unit_width (applet);
+#endif
}
if (applet->show_icon) {
@@ -521,7 +535,11 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu,
*x = menu_xpos;
*y = menu_ypos;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (push_in) *push_in = FALSE; /*fix botttom panel menu rendering in gtk3*/
+#else
*push_in = TRUE;
+#endif
}
static void