]> git.tdb.fi Git - ext/subsurface.git/blobdiff - gtk-gui.c
Merge branch 'master' into freediving-tweaks
[ext/subsurface.git] / gtk-gui.c
index 306e1a5e715ab8e5a6e890c3ce431cc2970ac218..f25fbaa53f6588a7968219784190d0cdcf4fff26 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -24,6 +24,7 @@ GtkWidget *vpane, *hpane;
 GtkWidget *notebook;
 
 int        error_count;
+extern char zoomed_plot;
 
 const char *divelist_font;
 
@@ -674,6 +675,13 @@ static void view_three(GtkWidget *w, gpointer data)
        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", NULL, "File", NULL, NULL, NULL},
        { "LogMenuAction",  NULL, "Log", NULL, NULL, NULL},
@@ -694,7 +702,8 @@ static GtkActionEntry menu_items[] = {
        { "ViewList",       NULL, "List",  CTRLCHAR "1", NULL, G_CALLBACK(view_list) },
        { "ViewProfile",    NULL, "Profile", CTRLCHAR "2", NULL, G_CALLBACK(view_profile) },
        { "ViewInfo",       NULL, "Info", CTRLCHAR "3", NULL, G_CALLBACK(view_info) },
-       { "ViewThree",       NULL, "Three", CTRLCHAR "4", NULL, G_CALLBACK(view_three) },
+       { "ViewThree",      NULL, "Three", CTRLCHAR "4", NULL, G_CALLBACK(view_three) },
+       { "ToggleZoom",     NULL, "Toggle Zoom", CTRLCHAR "0", NULL, G_CALLBACK(toggle_zoom) },
 };
 static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
 
@@ -716,6 +725,7 @@ static const gchar* ui_string = " \
                                <menuitem name=\"Add Dive\" action=\"AddDive\" /> \
                                <separator name=\"Separator\"/> \
                                <menuitem name=\"Renumber\" action=\"Renumber\" /> \
+                               <menuitem name=\"Toggle Zoom\" action=\"ToggleZoom\" /> \
                                <menu name=\"View\" action=\"ViewMenuAction\"> \
                                        <menuitem name=\"List\" action=\"ViewList\" /> \
                                        <menuitem name=\"Profile\" action=\"ViewProfile\" /> \