diff options
author | raveit65 <[email protected]> | 2015-10-15 23:10:29 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2015-10-15 23:10:29 +0200 |
commit | 554c6897ba818ee2384da8b5d4f54ac8a33ab1cd (patch) | |
tree | 7a17c675293b239e2b7733ddb9a657d81d42e7f3 /cpufreq/src/cpufreq-applet.c | |
parent | 33b1b5d423a23217ff3a9cc7b47e9e3f8e5e338d (diff) | |
download | mate-applets-554c6897ba818ee2384da8b5d4f54ac8a33ab1cd.tar.bz2 mate-applets-554c6897ba818ee2384da8b5d4f54ac8a33ab1cd.tar.xz |
GTK cpufreq: fix label position on horizontal panels
The issue was caused by using deprecated widgets and defines
for orientation with GTK3.
#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
Deprecated gtk_[h/v]box_new don't use them.
Diffstat (limited to 'cpufreq/src/cpufreq-applet.c')
-rw-r--r-- | cpufreq/src/cpufreq-applet.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index 317a1ef7..ffb4c332 100644 --- a/cpufreq/src/cpufreq-applet.c +++ b/cpufreq/src/cpufreq-applet.c @@ -953,6 +953,23 @@ cpufreq_applet_refresh (CPUFreqApplet *applet) } if (horizontal) { +#if GTK_CHECK_VERSION (3, 0, 0) + applet->labels_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + if ((label_size + pixmap_size) <= panel_size) + applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + else + applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + } else { + if (total_size <= panel_size) { + applet->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + applet->labels_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + } else if ((label_size + unit_label_size) <= (panel_size - size_step)) { + applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + applet->labels_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); + } else { + applet->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + applet->labels_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); +#else applet->labels_box = gtk_hbox_new (FALSE, 2); if ((label_size + pixmap_size) <= panel_size) applet->box = gtk_vbox_new (FALSE, 2); @@ -968,6 +985,7 @@ cpufreq_applet_refresh (CPUFreqApplet *applet) } else { applet->box = gtk_vbox_new (FALSE, 2); applet->labels_box = gtk_vbox_new (FALSE, 2); +#endif } } |