From ec37a4ececaecd61794913469b82a301919f8a08 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Thu, 15 Oct 2015 00:49:07 -0400 Subject: 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. --- cpufreq/src/cpufreq-applet.c | 22 ++++++++++++++++++++-- 1 file 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 -- cgit v1.2.1