summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Nathan Samson <nathansamson@gmail.com>2011-09-04 22:15:55 +0200
committerGravatar Nathan Samson <nathansamson@gmail.com>2011-09-04 22:15:55 +0200
commit6b075e0339f419555f08ece3a6c4a29407ecc32b (patch)
treec8c9df6d8690edddec8da8f8f3a87123f86dead0 /main.c
parentc4514b062a9866153c179d4b6ecf7972c9496891 (diff)
parentaab4d593bdbffef8442282318778a9833cbc7a43 (diff)
downloadsubsurface-6b075e0339f419555f08ece3a6c4a29407ecc32b.tar.gz
Merge hbonse's UI tweaks, but fixing the compile warnings. Also bringing it up to date with the master (and my own UI improvements)
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/main.c b/main.c
index 99c4b6f2a..b2fa6173e 100644
--- a/main.c
+++ b/main.c
@@ -175,10 +175,11 @@ int main(int argc, char **argv)
int i;
GtkWidget *win;
GtkWidget *divelist;
- GtkWidget *table;
+ GtkWidget *paned;
+ GtkWidget *info_box;
GtkWidget *notebook;
- GtkWidget *box;
GtkWidget *frame;
+ GtkWidget *dive_info;
GtkWidget *menubar;
GtkWidget *vbox;
@@ -208,36 +209,33 @@ int main(int argc, char **argv)
menubar = get_menubar_menu(win);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
- /* Table for the list of dives, cairo window, and dive info */
- table = gtk_table_new(2, 2, FALSE);
- gtk_container_set_border_width(GTK_CONTAINER(table), 5);
- gtk_box_pack_end(GTK_BOX(vbox), table, TRUE, TRUE, 0);
- gtk_table_set_col_spacings(GTK_TABLE(table), 6);
- gtk_widget_show(table);
+ /* HPane for left the dive list, and right the dive info */
+ paned = gtk_hpaned_new();
+ gtk_box_pack_end(GTK_BOX(vbox), paned, TRUE, TRUE, 0);
/* Create the atual divelist */
divelist = create_dive_list();
- gtk_table_attach(GTK_TABLE(table), divelist, 0, 1, 0, 2,
- 0, GTK_FILL | GTK_SHRINK | GTK_EXPAND, 0, 0);
+ gtk_paned_add1(GTK_PANED(paned), divelist);
+
+ /* VBox for dive info, and tabs */
+ info_box = gtk_vbox_new(FALSE, 6);
+ gtk_paned_add2(GTK_PANED(paned), info_box);
/* Frame for minimal dive info */
frame = dive_info_frame();
- gtk_table_attach(GTK_TABLE(table), frame, 1, 2, 0, 1,
- GTK_FILL | GTK_SHRINK | GTK_EXPAND, 0, 6, 6);
+ gtk_box_pack_start(GTK_BOX(info_box), frame, FALSE, TRUE, 6);
/* Notebook for dive info vs profile vs .. */
notebook = gtk_notebook_new();
- gtk_table_attach(GTK_TABLE(table), notebook, 1, 2, 1, 2,
- GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 6, 6);
+ gtk_box_pack_start(GTK_BOX(info_box), notebook, TRUE, TRUE, 6);
/* Frame for dive profile */
- frame = dive_profile_frame();
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, gtk_label_new("Dive Profile"));
- dive_profile = frame;
+ dive_profile = dive_profile_widget();
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_profile, gtk_label_new("Dive Profile"));
/* Frame for extended dive info */
- box = extended_dive_info_box();
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook), box, gtk_label_new("Extended Dive Info"));
+ dive_info = extended_dive_info_widget();
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dive_info, gtk_label_new("Extended Dive Info"));
gtk_widget_set_app_paintable(win, TRUE);
gtk_widget_show_all(win);