From: Maximilian Güntner Date: Tue, 21 Aug 2012 23:15:41 +0000 (+0200) Subject: Merge branch 'master' into freediving-tweaks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0c0ec7e4f60d9678c3950757ccb8f791f10d033c;p=ext%2Fsubsurface.git Merge branch 'master' into freediving-tweaks Signed-off-by: Maximilian Güntner --- 0c0ec7e4f60d9678c3950757ccb8f791f10d033c diff --cc gtk-gui.c index 4b9f002,306e1a5..f25fbaa --- a/gtk-gui.c +++ b/gtk-gui.c @@@ -21,8 -21,9 +21,10 @@@ GtkWidget *main_vbox GtkWidget *error_info_bar; GtkWidget *error_label; GtkWidget *vpane, *hpane; + GtkWidget *notebook; + int error_count; +extern char zoomed_plot; const char *divelist_font; @@@ -604,31 -661,32 +662,39 @@@ static void view_info(GtkWidget *w, gpo gtk_paned_set_position(GTK_PANED(hpane), 65535); } - /* Ooh. I don't know how to get the half-way size. So I'm just using random numbers */ static void view_three(GtkWidget *w, gpointer data) { - gtk_paned_set_position(GTK_PANED(hpane), 400); - gtk_paned_set_position(GTK_PANED(vpane), 200); + 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_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 void toggle_zoom(GtkWidget *w, gpointer data) +{ + zoomed_plot = (zoomed_plot)?0 : 1; + /*Update dive*/ + repaint_dive(); +} + static GtkActionEntry menu_items[] = { - { "FileMenuAction", GTK_STOCK_FILE, "File", NULL, NULL, NULL}, - { "LogMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL}, - { "ViewMenuAction", GTK_STOCK_FILE, "View", NULL, NULL, NULL}, - { "FilterMenuAction", GTK_STOCK_FILE, "Filter", NULL, NULL, NULL}, - { "HelpMenuAction", GTK_STOCK_HELP, "Help", NULL, NULL, NULL}, + { "FileMenuAction", NULL, "File", NULL, NULL, NULL}, + { "LogMenuAction", NULL, "Log", NULL, NULL, NULL}, + { "ViewMenuAction", NULL, "View", NULL, NULL, NULL}, + { "FilterMenuAction", NULL, "Filter", NULL, NULL, NULL}, + { "HelpMenuAction", NULL, "Help", NULL, NULL, NULL}, { "OpenFile", GTK_STOCK_OPEN, NULL, CTRLCHAR "O", NULL, G_CALLBACK(file_open) }, { "SaveFile", GTK_STOCK_SAVE, NULL, CTRLCHAR "S", NULL, G_CALLBACK(file_save) }, + { "SaveAsFile", GTK_STOCK_SAVE_AS, NULL, SHIFTCHAR CTRLCHAR "S", NULL, G_CALLBACK(file_save_as) }, { "Print", GTK_STOCK_PRINT, NULL, CTRLCHAR "P", NULL, G_CALLBACK(do_print) }, { "Import", NULL, "Import", NULL, NULL, G_CALLBACK(import_dialog) }, - { "Preferences", NULL, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) }, + { "AddDive", GTK_STOCK_ADD, "Add Dive", NULL, NULL, G_CALLBACK(add_dive_cb) }, + { "Preferences", GTK_STOCK_PREFERENCES, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) }, { "Renumber", NULL, "Renumber", NULL, NULL, G_CALLBACK(renumber_dialog) }, { "SelectEvents", NULL, "SelectEvents", NULL, NULL, G_CALLBACK(selectevents_dialog) }, { "Quit", GTK_STOCK_QUIT, NULL, CTRLCHAR "Q", NULL, G_CALLBACK(quit) }, @@@ -655,9 -713,9 +722,10 @@@ static const gchar* ui_string = " \ \ \ + \ \ \ + \ \ \ \