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>
GtkWidget *error_info_bar;
GtkWidget *error_label;
GtkWidget *vpane, *hpane;
GtkWidget *error_info_bar;
GtkWidget *error_label;
GtkWidget *vpane, *hpane;
int error_count;
const char *divelist_font;
int error_count;
const char *divelist_font;
static void view_three(GtkWidget *w, gpointer data)
{
GtkAllocation alloc;
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_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[] = {
}
static GtkActionEntry menu_items[] = {
void init_ui(int *argcp, char ***argvp)
{
GtkWidget *win;
void init_ui(int *argcp, char ***argvp)
{
GtkWidget *win;
GtkWidget *nb_page;
GtkWidget *dive_list;
GtkWidget *menubar;
GtkWidget *nb_page;
GtkWidget *dive_list;
GtkWidget *menubar;