mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 01:33:23 +00:00
Only store pane positions if we currently display "View Three"
We tried to detect this without needing a global variable but that clearly was too dependent on decorations that the window manager might add. This code works reliably. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0129192958
commit
d8811e2e40
1 changed files with 13 additions and 4 deletions
17
gtk-gui.c
17
gtk-gui.c
|
@ -43,6 +43,9 @@ GtkWidget *notebook;
|
|||
int error_count;
|
||||
const char *existing_filename;
|
||||
|
||||
typedef enum { PANE_INFO, PANE_PROFILE, PANE_LIST, PANE_THREE } pane_conf_t;
|
||||
static pane_conf_t pane_conf;
|
||||
|
||||
static struct device_info *holdnicknames = NULL;
|
||||
static GtkWidget *dive_profile_widget(void);
|
||||
static void import_files(GtkWidget *, gpointer);
|
||||
|
@ -1173,22 +1176,28 @@ static void show_user_manual(GtkWidget *w, gpointer data)
|
|||
|
||||
static void view_list(GtkWidget *w, gpointer data)
|
||||
{
|
||||
save_pane_position();
|
||||
if (pane_conf == PANE_THREE)
|
||||
save_pane_position();
|
||||
gtk_paned_set_position(GTK_PANED(vpane), 0);
|
||||
pane_conf = PANE_LIST;
|
||||
}
|
||||
|
||||
static void view_profile(GtkWidget *w, gpointer data)
|
||||
{
|
||||
save_pane_position();
|
||||
if (pane_conf == PANE_THREE)
|
||||
save_pane_position();
|
||||
gtk_paned_set_position(GTK_PANED(hpane), 0);
|
||||
gtk_paned_set_position(GTK_PANED(vpane), 65535);
|
||||
pane_conf = PANE_PROFILE;
|
||||
}
|
||||
|
||||
static void view_info(GtkWidget *w, gpointer data)
|
||||
{
|
||||
save_pane_position();
|
||||
if (pane_conf == PANE_THREE)
|
||||
save_pane_position();
|
||||
gtk_paned_set_position(GTK_PANED(vpane), 65535);
|
||||
gtk_paned_set_position(GTK_PANED(hpane), 65535);
|
||||
pane_conf = PANE_INFO;
|
||||
}
|
||||
|
||||
static void view_three(GtkWidget *w, gpointer data)
|
||||
|
@ -1214,7 +1223,7 @@ static void view_three(GtkWidget *w, gpointer data)
|
|||
else
|
||||
gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6);
|
||||
|
||||
|
||||
pane_conf = PANE_THREE;
|
||||
}
|
||||
|
||||
static void toggle_zoom(GtkWidget *w, gpointer data)
|
||||
|
|
Loading…
Add table
Reference in a new issue