diff options
author | Robert C. Helling <helling@atdotde.de> | 2013-03-03 20:30:04 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-03-03 11:56:51 -0800 |
commit | 9fcb28a6f5f5b9c3dcc6a6f40760cbe18f31f76f (patch) | |
tree | 2dfc81cb84ae5312acaa9a6b7f9e2bfba04022a6 /gtk-gui.c | |
parent | 0e7f0cc1ed98633ae3e8b855fc7a5051d3e37d42 (diff) | |
download | subsurface-9fcb28a6f5f5b9c3dcc6a6f40760cbe18f31f76f.tar.gz |
Fix pane position bug
Argh. Maxint is not at the bottom or at the right. We have to check
against the size of the window to determine we are not saving a maximized
position. Here is a fix.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -327,9 +327,12 @@ void save_pane_position() { gint vpane_position = gtk_paned_get_position(GTK_PANED(vpane)); gint hpane_position = gtk_paned_get_position(GTK_PANED(hpane)); - if (vpane_position && vpane_position != 65535) + int window_width, window_height; + gtk_window_get_size(GTK_WINDOW (main_window), &window_width, &window_height); + + if (vpane_position && vpane_position < window_height - 12) subsurface_set_conf_int("vpane_position", vpane_position); - if (hpane_position && hpane_position != 65535) + if (hpane_position && hpane_position < window_width - 6 ) subsurface_set_conf_int("hpane_position", hpane_position); } @@ -1198,7 +1201,7 @@ static void view_three(GtkWidget *w, gpointer data) gtk_widget_get_allocation(hpane, &alloc); - if (hpane_position && hpane_position != 65535) + if (hpane_position) gtk_paned_set_position(GTK_PANED(hpane), hpane_position); else gtk_paned_set_position(GTK_PANED(hpane), alloc.width/2); @@ -1206,7 +1209,7 @@ static void view_three(GtkWidget *w, gpointer data) gtk_widget_get_allocation(vpane, &alloc); gtk_widget_size_request(notebook, &requisition); /* pick the requested size for the notebook plus 6 pixels for frame */ - if (vpane_position && vpane_position != 65535) + if (vpane_position) gtk_paned_set_position(GTK_PANED(vpane), vpane_position); else gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6); |