summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-16 05:09:19 +0000
committerDavid Robillard <d@drobilla.net>2011-03-16 05:09:19 +0000
commit11017eeacd3277773707d53093725c01f2301772 (patch)
tree963ca42784ab8f2c053f7f9730b12b1fb7c74663 /src/gui
parentb3786217c82ff2f12a73595ecc375916d6e9d169 (diff)
downloadingen-11017eeacd3277773707d53093725c01f2301772.tar.gz
ingen-11017eeacd3277773707d53093725c01f2301772.tar.bz2
ingen-11017eeacd3277773707d53093725c01f2301772.zip
Font-based sizing (implement ticket #374).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3099 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/PatchWindow.cpp31
-rw-r--r--src/gui/PatchWindow.hpp6
-rw-r--r--src/gui/ingen_gui.glade59
3 files changed, 86 insertions, 10 deletions
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index a928b315..adbfc933 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -87,6 +87,9 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
xml->get_widget("patch_fullscreen_menuitem", _menu_fullscreen);
xml->get_widget("patch_human_names_menuitem", _menu_human_names);
xml->get_widget("patch_show_port_names_menuitem", _menu_show_port_names);
+ xml->get_widget("patch_zoom_in_menuitem", _menu_zoom_in);
+ xml->get_widget("patch_zoom_out_menuitem", _menu_zoom_out);
+ xml->get_widget("patch_zoom_normal_menuitem", _menu_zoom_normal);
xml->get_widget("patch_status_bar_menuitem", _menu_show_status_bar);
xml->get_widget("patch_arrange_menuitem", _menu_arrange);
xml->get_widget("patch_view_messages_window_menuitem", _menu_view_messages_window);
@@ -135,6 +138,14 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad
sigc::mem_fun(this, &PatchWindow::event_port_names_toggled));
_menu_arrange->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_arrange));
+ _menu_quit->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_quit));
+ _menu_zoom_in->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_zoom_in));
+ _menu_zoom_out->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_zoom_out));
+ _menu_zoom_normal->signal_activate().connect(
+ sigc::mem_fun(this, &PatchWindow::event_zoom_normal));
_menu_view_engine_window->signal_activate().connect(
sigc::mem_fun(this, &PatchWindow::event_show_engine));
_menu_view_control_window->signal_activate().connect(
@@ -643,6 +654,26 @@ PatchWindow::event_quit()
void
+PatchWindow::event_zoom_in()
+{
+ _view->canvas()->set_font_size(_view->canvas()->get_font_size() + 1.0);
+}
+
+void
+PatchWindow::event_zoom_out()
+{
+ _view->canvas()->set_font_size(_view->canvas()->get_font_size() - 1.0);
+}
+
+
+void
+PatchWindow::event_zoom_normal()
+{
+ _view->canvas()->set_zoom_and_font_size(1.0, _view->canvas()->get_default_font_size());
+}
+
+
+void
PatchWindow::event_arrange()
{
_view->canvas()->arrange(false, false);
diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp
index 28abdc57..aafb9d2c 100644
--- a/src/gui/PatchWindow.hpp
+++ b/src/gui/PatchWindow.hpp
@@ -96,6 +96,9 @@ private:
void event_status_bar_toggled();
void event_human_names_toggled();
void event_port_names_toggled();
+ void event_zoom_in();
+ void event_zoom_out();
+ void event_zoom_normal();
void event_arrange();
void event_show_properties();
void event_show_controls();
@@ -131,6 +134,9 @@ private:
Gtk::CheckMenuItem* _menu_human_names;
Gtk::CheckMenuItem* _menu_show_port_names;
Gtk::CheckMenuItem* _menu_show_status_bar;
+ Gtk::MenuItem* _menu_zoom_in;
+ Gtk::MenuItem* _menu_zoom_out;
+ Gtk::MenuItem* _menu_zoom_normal;
Gtk::MenuItem* _menu_fullscreen;
Gtk::MenuItem* _menu_arrange;
Gtk::MenuItem* _menu_view_engine_window;
diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade
index 10dd355c..15e38061 100644
--- a/src/gui/ingen_gui.glade
+++ b/src/gui/ingen_gui.glade
@@ -266,16 +266,6 @@
<child>
<widget class="GtkMenu" id="patch_patch_menu_menu">
<child>
- <widget class="GtkImageMenuItem" id="patch_fullscreen_menuitem">
- <property name="label">gtk-fullscreen</property>
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="use_stock">True</property>
- <signal name="activate" handler="patch_fullscreen_menuitem"/>
- <accelerator key="F11" signal="activate"/>
- </widget>
- </child>
- <child>
<widget class="GtkCheckMenuItem" id="patch_human_names_menuitem">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Show human readable names instead of identifiers</property>
@@ -304,6 +294,55 @@
<accelerator key="b" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</widget>
</child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="&lt;separator&gt;">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="patch_zoom_in_menuitem">
+ <property name="label">gtk-zoom-in</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Increase font size</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="patch_zoom_out_menuitem">
+ <property name="label">gtk-zoom-out</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Decrease font size</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="minus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="patch_zoom_normal_menuitem">
+ <property name="label">gtk-zoom-100</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="0" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="patch_fullscreen_menuitem">
+ <property name="visible">True</property>
+ <property name="label">gtk-fullscreen</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="patch_fullscreen_menuitem"/>
+ <accelerator key="F11" signal="activate"/>
+ </widget>
+ </child>
</widget>
</child>
</widget>