summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-18 18:06:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-18 18:06:32 -0700
commited1ce8ebc8590533291a9c5d6460f8d1c9f857dd (patch)
treea83e13c7b7fef2db738bcb57a4fd09766ea52c5d
parented6356f7d9a69440c463ed750ab5bcb9f67819bc (diff)
downloadsubsurface-ed1ce8ebc8590533291a9c5d6460f8d1c9f857dd.tar.gz
Fix default size for scrollable notebook
Linus change in commit bcb9f67819bc ("Make the notebook portion (dive notes/equipment/info) a scrollable window") created a really ugly default where the notebook Dive Notes always ended up with a vertical scrollbar. This picks a much saner default layout for the panes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 4e5b9edfb..306e1a5e7 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -21,6 +21,8 @@ GtkWidget *main_vbox;
GtkWidget *error_info_bar;
GtkWidget *error_label;
GtkWidget *vpane, *hpane;
+GtkWidget *notebook;
+
int error_count;
const char *divelist_font;
@@ -662,10 +664,14 @@ static void view_info(GtkWidget *w, gpointer data)
static void view_three(GtkWidget *w, gpointer data)
{
GtkAllocation alloc;
+ GtkRequisition requisition;
+
gtk_widget_get_allocation(hpane, &alloc);
gtk_paned_set_position(GTK_PANED(hpane), alloc.width/2);
gtk_widget_get_allocation(vpane, &alloc);
- gtk_paned_set_position(GTK_PANED(vpane), alloc.height/2);
+ gtk_widget_size_request(notebook, &requisition);
+ /* pick the requested size for the notebook plus 6 pixels for frame */
+ gtk_paned_set_position(GTK_PANED(vpane), requisition.height + 6);
}
static GtkActionEntry menu_items[] = {
@@ -750,7 +756,6 @@ static void switch_page(GtkNotebook *notebook, gint arg1, gpointer user_data)
void init_ui(int *argcp, char ***argvp)
{
GtkWidget *win;
- GtkWidget *notebook;
GtkWidget *nb_page;
GtkWidget *dive_list;
GtkWidget *menubar;