aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-09 13:54:20 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-09 13:54:20 +0100
commit73b611a84493059e7aafdd8cf2f59b3f7975ed26 (patch)
tree21c68d4edd70febd4529d59a05b3b9699549ed09
parent10280a1949ca5c3826cb91431d3cbf393dc523e6 (diff)
downloadlogdiag-73b611a84493059e7aafdd8cf2f59b3f7975ed26.tar.gz
logdiag-73b611a84493059e7aafdd8cf2f59b3f7975ed26.tar.xz
logdiag-73b611a84493059e7aafdd8cf2f59b3f7975ed26.zip
Add a View menu to LdWindowMain, disabled so far.
-rw-r--r--share/gui/window-main.ui5
-rw-r--r--src/ld-window-main.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/share/gui/window-main.ui b/share/gui/window-main.ui
index 000017d..ad8037c 100644
--- a/share/gui/window-main.ui
+++ b/share/gui/window-main.ui
@@ -20,6 +20,11 @@
<separator />
<menuitem action="SelectAll" />
</menu>
+ <menu name="ViewMenu" action="ViewMenu">
+ <menuitem action="ZoomIn" />
+ <menuitem action="ZoomOut" />
+ <menuitem action="NormalSize" />
+ </menu>
<menu name="HelpMenu" action="HelpMenu">
<menuitem action="About" />
</menu>
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 4ba86b3..71717ac 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -197,7 +197,16 @@ static GtkActionEntry wm_action_entries[] =
Q_("Select all objects in the diagram"),
NULL},
- /* TODO: View menu (zooming). */
+ {"ViewMenu", NULL, Q_("_View"), NULL, NULL, NULL},
+ {"ZoomIn", GTK_STOCK_ZOOM_IN, Q_("_Zoom In"), "<Ctrl>plus",
+ Q_("Zoom into the diagram"),
+ NULL},
+ {"ZoomOut", GTK_STOCK_ZOOM_OUT, Q_("Zoom _Out"), "<Ctrl>minus",
+ Q_("Zoom out of the diagram"),
+ NULL},
+ {"NormalSize", GTK_STOCK_ZOOM_100, Q_("_Normal Size"), "<Ctrl>0",
+ Q_("Reset zoom level back to the default"),
+ NULL},
{"HelpMenu", NULL, Q_("_Help"), NULL, NULL, NULL},
{"About", GTK_STOCK_ABOUT, Q_("_About"), NULL,
@@ -354,6 +363,9 @@ ld_window_main_init (LdWindowMain *self)
action_set_sensitive (self, "Export", FALSE);
action_set_sensitive (self, "Delete", FALSE);
action_set_sensitive (self, "SelectAll", FALSE);
+ action_set_sensitive (self, "ZoomIn", FALSE);
+ action_set_sensitive (self, "ZoomOut", FALSE);
+ action_set_sensitive (self, "NormalSize", FALSE);
gtk_widget_grab_focus (GTK_WIDGET (priv->canvas));