diff options
author | Maximilian Güntner <maximilian.guentner@gmail.com> | 2012-06-11 02:45:36 +0200 |
---|---|---|
committer | Maximilian Güntner <maximilian.guentner@gmail.com> | 2012-06-11 02:45:36 +0200 |
commit | 7acd075bd5ad1c6d42ba77b484aebc2a0572f710 (patch) | |
tree | a3b288e4dd5263dc63e6080782c1c80d030767e4 /gtk-gui.c | |
parent | 0a7fa8ea50ad65b350ebcc435dd47eae02d8bcbe (diff) | |
download | subsurface-7acd075bd5ad1c6d42ba77b484aebc2a0572f710.tar.gz |
added "Zoom" button and improved scaling
It should be possible to have a certain limit where we
stop zooming so that short dives are visible as such
at first glance. Therefore a "Zoom" button has been
added to the "Log" menu along with a shortcut (Ctrl + "0").
The user can now zoom/unzoom the plot and is still able to
quickly distinguish short dives from normal ones when
browsing the log.
Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -22,6 +22,7 @@ GtkWidget *error_info_bar; GtkWidget *error_label; GtkWidget *vpane, *hpane; int error_count; +extern char zoomed_plot; const char *divelist_font; @@ -610,6 +611,13 @@ static void view_three(GtkWidget *w, gpointer data) gtk_paned_set_position(GTK_PANED(vpane), 200); } +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}, @@ -628,7 +636,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]); @@ -648,6 +657,7 @@ static const gchar* ui_string = " \ <menuitem name=\"Import\" action=\"Import\" /> \ <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\" /> \ |