[Xfce4-commits] <xfce4-weather-plugin:master> Further optimize summary window height.
Harald Judt
noreply at xfce.org
Fri Jul 13 16:50:26 CEST 2012
Updating branch refs/heads/master
to 30ac02269b70bda168c7ac9e24856d4cf4ae3b82 (commit)
from 3293bacf64e190c858d2a321f5022cba8cc3332e (commit)
commit 30ac02269b70bda168c7ac9e24856d4cf4ae3b82
Author: Harald Judt <h.judt at gmx.at>
Date: Fri Jul 13 15:53:48 2012 +0200
Further optimize summary window height.
Optimize calculation introduced in b5d407d72cc470723035a9f66baa0a368ae917cf.
panel-plugin/weather-summary.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c
index 960a872..21f265d 100644
--- a/panel-plugin/weather-summary.c
+++ b/panel-plugin/weather-summary.c
@@ -529,13 +529,20 @@ create_forecast_tab (xfceweather_data *data, GtkWidget *window)
GdkScreen *screen;
GdkRectangle rect;
gint monitor_num, height_needed, height_max;
+ gdouble factor;
/* calculate maximum height we may use, subtracting some sane value for safety */
screen = gtk_window_get_screen(GTK_WINDOW(window));
win = GTK_WIDGET(window)->window;
monitor_num = gdk_screen_get_monitor_at_window(GDK_SCREEN(screen), GDK_WINDOW(win));
gdk_screen_get_monitor_geometry(GDK_SCREEN(screen), monitor_num, &rect);
- height_max = rect.height * 0.85 - 200;
+
+ /* optimize max height a bit depending on common resolutions */
+ if ((rect.height > 600 && rect.height <= 800) || rect.height <= 480)
+ factor = 0.85;
+ else
+ factor = 0.90;
+ height_max = rect.height * factor - 200;
/* calculate height needed using a good arbitrary value */
height_needed = data->forecast_days * 110;
More information about the Xfce4-commits
mailing list