mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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>
This commit is contained in:
parent
0e7f0cc1ed
commit
9fcb28a6f5
1 changed files with 7 additions and 4 deletions
11
gtk-gui.c
11
gtk-gui.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue