]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Remove the redundant frames in the notebook. Closes #9
authorNathan Samson <nathansamson@gmail.com>
Sun, 4 Sep 2011 17:01:30 +0000 (19:01 +0200)
committerNathan Samson <nathansamson@gmail.com>
Sun, 4 Sep 2011 17:01:30 +0000 (19:01 +0200)
Signed-off-by: Nathan Samson <nathansamson@gmail.com>
display.h
info.c
main.c
profile.c

index f336bd5ec8ac60ba7b32cd82bfe5126a88bd2640..96fa29a5d574168b8d07b06b4410fff4a874de75 100644 (file)
--- a/display.h
+++ b/display.h
@@ -8,9 +8,9 @@
 extern int selected_dive;
 #define current_dive (get_dive(selected_dive))
 
-extern GtkWidget *dive_profile_frame(void);
+extern GtkWidget *dive_profile_widget(void);
 extern GtkWidget *dive_info_frame(void);
-extern GtkWidget *extended_dive_info_frame(void);
+extern GtkWidget *extended_dive_info_widget(void);
 extern GtkWidget *create_dive_list(void);
 extern void update_dive_info(struct dive *dive);
 extern void repaint_dive(void);
diff --git a/info.c b/info.c
index 55708bedfd7b103313810034398749d2364659d9..4275ad6ff7b32c7973059b12dd487e7b1d8657bb 100644 (file)
--- a/info.c
+++ b/info.c
@@ -164,21 +164,16 @@ static GtkTextBuffer *text_entry(GtkWidget *box, const char *label, gboolean exp
        return buffer;
 }
 
-GtkWidget *extended_dive_info_frame(void)
+GtkWidget *extended_dive_info_widget(void)
 {
-       GtkWidget *frame;
        GtkWidget *vbox;
 
-       frame = gtk_frame_new("Extended dive info");
-       gtk_widget_show(frame);
-
        vbox = gtk_vbox_new(FALSE, 5);
-       gtk_container_add(GTK_CONTAINER(frame), vbox);
 
        location = text_entry(vbox, "Location", FALSE);
        notes = text_entry(vbox, "Notes", TRUE);
 
        /* Add extended info here: name, description, yadda yadda */
        update_dive_info(current_dive);
-       return frame;
+       return vbox;
 }
diff --git a/main.c b/main.c
index b748f693b5f1dfec00ae8b27360fc0dabc92905c..57c8f70e66a92a67c22c263a9c2ca737e378313a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -178,6 +178,7 @@ int main(int argc, char **argv)
        GtkWidget *info_box;
        GtkWidget *notebook;
        GtkWidget *frame;
+       GtkWidget *dive_info;
        GtkWidget *menubar;
        GtkWidget *vbox;
 
@@ -228,13 +229,12 @@ int main(int argc, char **argv)
        gtk_box_pack_start(GTK_BOX(info_box), notebook, TRUE, TRUE, 5);
 
        /* 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 */
-       frame = extended_dive_info_frame();
-       gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, 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);
index 7a0a20828f07c433ed3625bc54bcd8def420619e..070e6fa7054445e26031335c4c1b5e1ac35ccbff 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -195,17 +195,13 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer
        return FALSE;
 }
 
-GtkWidget *dive_profile_frame(void)
+GtkWidget *dive_profile_widget(void)
 {
-       GtkWidget *frame;
        GtkWidget *da;
 
-       frame = gtk_frame_new("Dive profile");
-       gtk_widget_show(frame);
        da = gtk_drawing_area_new();
        gtk_widget_set_size_request(da, 450, 350);
        g_signal_connect(da, "expose_event", G_CALLBACK(expose_event), NULL);
-       gtk_container_add(GTK_CONTAINER(frame), da);
 
-       return frame;
+       return da;
 }