summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-03-31 05:52:08 +0000
committerDavid Robillard <d@drobilla.net>2014-03-31 05:52:08 +0000
commit5ef495e58358dcf28d45e69574f189ac51376a39 (patch)
tree26469ddbf4ebf512bffa32c18482658365d2501c
parent33ef5af23ef2eccb11de1ddbd860020f2fd8baae (diff)
downloadingen-5ef495e58358dcf28d45e69574f189ac51376a39.tar.gz
ingen-5ef495e58358dcf28d45e69574f189ac51376a39.tar.bz2
ingen-5ef495e58358dcf28d45e69574f189ac51376a39.zip
Add zoom full and font size commands to Ingen.
Consistent font size keybindings between Patchage and Ingen. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5356 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/gui/GraphBox.cpp34
-rw-r--r--src/gui/GraphBox.hpp8
-rw-r--r--src/gui/ingen_gui.ui55
3 files changed, 93 insertions, 4 deletions
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index 913bcc52..d2b6b84f 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -95,6 +95,10 @@ GraphBox::GraphBox(BaseObjectType* cobject,
xml->get_widget("graph_zoom_in_menuitem", _menu_zoom_in);
xml->get_widget("graph_zoom_out_menuitem", _menu_zoom_out);
xml->get_widget("graph_zoom_normal_menuitem", _menu_zoom_normal);
+ xml->get_widget("graph_zoom_full_menuitem", _menu_zoom_full);
+ xml->get_widget("graph_increase_font_size_menuitem", _menu_increase_font_size);
+ xml->get_widget("graph_decrease_font_size_menuitem", _menu_decrease_font_size);
+ xml->get_widget("graph_normal_font_size_menuitem", _menu_normal_font_size);
xml->get_widget("graph_doc_pane_menuitem", _menu_show_doc_pane);
xml->get_widget("graph_status_bar_menuitem", _menu_show_status_bar);
xml->get_widget("graph_arrange_menuitem", _menu_arrange);
@@ -149,6 +153,14 @@ GraphBox::GraphBox(BaseObjectType* cobject,
sigc::mem_fun(this, &GraphBox::event_zoom_out));
_menu_zoom_normal->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_zoom_normal));
+ _menu_zoom_full->signal_activate().connect(
+ sigc::mem_fun(this, &GraphBox::event_zoom_full));
+ _menu_increase_font_size->signal_activate().connect(
+ sigc::mem_fun(this, &GraphBox::event_increase_font_size));
+ _menu_decrease_font_size->signal_activate().connect(
+ sigc::mem_fun(this, &GraphBox::event_decrease_font_size));
+ _menu_normal_font_size->signal_activate().connect(
+ sigc::mem_fun(this, &GraphBox::event_normal_font_size));
_menu_view_engine_window->signal_activate().connect(
sigc::mem_fun(this, &GraphBox::event_show_engine));
_menu_view_graph_properties->signal_activate().connect(
@@ -674,6 +686,28 @@ GraphBox::event_zoom_normal()
}
void
+GraphBox::event_zoom_full()
+{
+ _view->canvas()->zoom_full();
+}
+
+void
+GraphBox::event_increase_font_size()
+{
+ _view->canvas()->set_font_size(_view->canvas()->get_font_size() + 1.0);
+}
+void
+GraphBox::event_decrease_font_size()
+{
+ _view->canvas()->set_font_size(_view->canvas()->get_font_size() - 1.0);
+}
+void
+GraphBox::event_normal_font_size()
+{
+ _view->canvas()->set_font_size(_view->canvas()->get_default_font_size());
+}
+
+void
GraphBox::event_arrange()
{
_view->canvas()->arrange();
diff --git a/src/gui/GraphBox.hpp b/src/gui/GraphBox.hpp
index e06a7c5a..92c4cd0b 100644
--- a/src/gui/GraphBox.hpp
+++ b/src/gui/GraphBox.hpp
@@ -122,6 +122,10 @@ private:
void event_zoom_in();
void event_zoom_out();
void event_zoom_normal();
+ void event_zoom_full();
+ void event_increase_font_size();
+ void event_decrease_font_size();
+ void event_normal_font_size();
void event_arrange();
void event_show_properties();
void event_show_engine();
@@ -156,6 +160,10 @@ private:
Gtk::MenuItem* _menu_zoom_in;
Gtk::MenuItem* _menu_zoom_out;
Gtk::MenuItem* _menu_zoom_normal;
+ Gtk::MenuItem* _menu_zoom_full;
+ Gtk::MenuItem* _menu_increase_font_size;
+ Gtk::MenuItem* _menu_decrease_font_size;
+ Gtk::MenuItem* _menu_normal_font_size;
Gtk::MenuItem* _menu_fullscreen;
Gtk::MenuItem* _menu_arrange;
Gtk::MenuItem* _menu_view_engine_window;
diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui
index 8463b435..88bf08d5 100644
--- a/src/gui/ingen_gui.ui
+++ b/src/gui/ingen_gui.ui
@@ -205,7 +205,7 @@ Contributors:
</object>
</child>
<child>
- <object class="GtkSeparatorMenuItem" id="menuitem6">
+ <object class="GtkSeparatorMenuItem" id="menuitem7">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -876,7 +876,7 @@ Contributors:
<object class="GtkMenu" id="edit2_menu">
<property name="can_focus">False</property>
<child>
- <object class="GtkSeparatorMenuItem" id="menuitem4">
+ <object class="GtkSeparatorMenuItem" id="menuitem5">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -1026,7 +1026,7 @@ Contributors:
</object>
</child>
<child>
- <object class="GtkSeparatorMenuItem" id="menuitem5">
+ <object class="GtkSeparatorMenuItem" id="menuitem6">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -1076,7 +1076,7 @@ Contributors:
</object>
</child>
<child>
- <object class="GtkSeparatorMenuItem" id="&lt;separator&gt;">
+ <object class="GtkSeparatorMenuItem" id="separator1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -1115,12 +1115,59 @@ Contributors:
</object>
</child>
<child>
+ <object class="GtkImageMenuItem" id="graph_zoom_full_menuitem">
+ <property name="label">gtk-zoom-fit</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="F" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
<object class="GtkSeparatorMenuItem" id="menuitem3">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
+ <object class="GtkMenuItem" id="graph_increase_font_size_menuitem">
+ <property name="label" translatable="yes">_Increase Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Up" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="graph_decrease_font_size_menuitem">
+ <property name="label" translatable="yes">_Decrease Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <accelerator key="Down" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="graph_normal_font_size_menuitem">
+ <property name="label" translatable="yes">_Normal Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <accelerator key="1" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="menuitem4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
<object class="GtkImageMenuItem" id="graph_fullscreen_menuitem">
<property name="label">gtk-fullscreen</property>
<property name="use_action_appearance">False</property>