From 5ef495e58358dcf28d45e69574f189ac51376a39 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 31 Mar 2014 05:52:08 +0000 Subject: 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 --- src/gui/GraphBox.cpp | 34 ++++++++++++++++++++++++++++++++ src/gui/GraphBox.hpp | 8 ++++++++ src/gui/ingen_gui.ui | 55 ++++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 93 insertions(+), 4 deletions(-) (limited to 'src') 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( @@ -673,6 +685,28 @@ GraphBox::event_zoom_normal() _view->canvas()->set_zoom(1.0); } +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() { 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: - + True False @@ -876,7 +876,7 @@ Contributors: False - + True False @@ -1026,7 +1026,7 @@ Contributors: - + False True False @@ -1076,7 +1076,7 @@ Contributors: - + True False @@ -1114,12 +1114,59 @@ Contributors: + + + gtk-zoom-fit + False + True + False + True + True + + + True False + + + _Increase Font Size + False + True + False + True + + + + + + _Decrease Font Size + False + True + False + True + + + + + + _Normal Font Size + False + True + False + True + + + + + + True + False + + gtk-fullscreen -- cgit v1.2.1