summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-28 13:20:23 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-28 13:20:23 -0700
commit9d46581913ce33664e333a4d6eaf7f4e26e20b1c (patch)
tree13dea8e7ad2f28a9c705daf3ea6885a9cbc79065 /gtk-gui.c
parente4955f9be116cd413e8ee3986d737e9e1b95e348 (diff)
parent03eb488dd238bcec4b4758eab4559b3c40e6435c (diff)
downloadsubsurface-9d46581913ce33664e333a4d6eaf7f4e26e20b1c.tar.gz
Merge branch 'freediving-tweaks' of git://github.com/mguentner/subsurface
Merge freediving tweaks (zoom in on short dives etc) from Maximilian Güntner. Trivial conflicts in display.h due to unrelated printing stuff just happening to be added nearby. * 'freediving-tweaks' of git://github.com/mguentner/subsurface: moved zoomed_plot to display.h plot the time with a fixed padding (leading zero) updated/corrected comment added "Zoom" button and improved scaling fixed indentation use increments that make sense for 600 seconds Plot shorter (apnea) dives with a reasonable scale
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 2a4d77ac9..7db777ab9 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -729,6 +729,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},
@@ -749,7 +756,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]);
@@ -771,6 +779,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\" /> \