summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-11-19 12:54:58 -0800
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-11-19 12:54:58 -0800
commitc36bf636bd8e6f8fdd700a5031ea3e1a7dc0827e (patch)
tree0b90b449ce4e7ba2ef2238f31a7ced7185ee5812
parent25e18211ec99ff15c26315eff87fc31816ce8f33 (diff)
downloadsubsurface-c36bf636bd8e6f8fdd700a5031ea3e1a7dc0827e.tar.gz
Experimental hard-coded three-pane layout
I'm not happy with it, but it looks good and works better than the alternatives I've looked at so far. So why not happy? It's not configurable, and gtk really doesn't do a great job with the case of notebook widgets that are shrunk to be smaller than the contents (the cut-off gets ugly, and is outside the notebook page!) But committing as a way to keep track of this, and let Dirk use it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--gtk-gui.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index c78d7e667..f4212b41c 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -749,6 +749,7 @@ void init_ui(int *argcp, char ***argvp)
GtkWidget *stats;
GtkWidget *menubar;
GtkWidget *vbox;
+ GtkWidget *hpane, *vpane;
GdkScreen *screen;
GtkIconTheme *icon_theme=NULL;
GtkSettings *settings;
@@ -845,9 +846,15 @@ void init_ui(int *argcp, char ***argvp)
menubar = get_menubar_menu(win);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
+ vpane = gtk_vpaned_new();
+ gtk_box_pack_start(GTK_BOX(vbox), vpane, TRUE, TRUE, 3);
+
+ hpane = gtk_hpaned_new();
+ gtk_paned_add1(GTK_PANED(vpane), hpane);
+
/* Notebook for dive info vs profile vs .. */
notebook = gtk_notebook_new();
- gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 6);
+ gtk_paned_add1(GTK_PANED(hpane), notebook);
gtk_notebook_set_group(GTK_NOTEBOOK(notebook), GRP_ID);
g_signal_connect(notebook, "create-window", G_CALLBACK(create_new_notebook_window), NULL);
gtk_drag_dest_set(notebook, GTK_DEST_DEFAULT_ALL, &notebook_target, 1, GDK_ACTION_MOVE);
@@ -857,16 +864,12 @@ void init_ui(int *argcp, char ***argvp)
/* Create the actual divelist */
dive_list = dive_list_create();
gtk_widget_set_name(dive_list, "Dive List");
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_list, gtk_label_new("Dive List"));
- gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(notebook), dive_list, 1);
- gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(notebook), dive_list, 1);
+ gtk_paned_add2(GTK_PANED(vpane), dive_list);
/* Frame for dive profile */
dive_profile = dive_profile_widget();
gtk_widget_set_name(dive_profile, "Dive Profile");
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_profile, gtk_label_new("Dive Profile"));
- gtk_notebook_set_tab_detachable(GTK_NOTEBOOK(notebook), dive_profile, 1);
- gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(notebook), dive_profile, 1);
+ gtk_paned_add2(GTK_PANED(hpane), dive_profile);
/* Frame for extended dive info */
dive_info = extended_dive_info_widget();