diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 30 | ||||
-rw-r--r-- | src/Patchage.hpp | 7 | ||||
-rw-r--r-- | src/patchage.glade | 37 |
3 files changed, 74 insertions, 0 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 424b47c..f452bda 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -132,6 +132,9 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_menu_view_projects) , INIT_WIDGET(_menu_view_refresh) , INIT_WIDGET(_menu_view_toolbar) + , INIT_WIDGET(_menu_zoom_in) + , INIT_WIDGET(_menu_zoom_out) + , INIT_WIDGET(_menu_zoom_normal) , INIT_WIDGET(_messages_clear_but) , INIT_WIDGET(_messages_close_but) , INIT_WIDGET(_messages_win) @@ -230,6 +233,12 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::on_show_projects)); _menu_help_about->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_help_about)); + _menu_zoom_in->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_zoom_in)); + _menu_zoom_out->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_zoom_out)); + _menu_zoom_normal->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_zoom_normal)); _messages_clear_but->signal_clicked().connect( sigc::mem_fun(this, &Patchage::on_messages_clear)); @@ -630,6 +639,27 @@ Patchage::on_help_about() void +Patchage::on_zoom_in() +{ + _canvas->set_font_size(_canvas->get_font_size() + 1.0); +} + + +void +Patchage::on_zoom_out() +{ + _canvas->set_font_size(_canvas->get_font_size() - 1.0); +} + + +void +Patchage::on_zoom_normal() +{ + _canvas->set_zoom_and_font_size(1.0, _canvas->get_default_font_size()); +} + + +void Patchage::on_messages_clear() { _status_text->get_buffer()->erase( diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 58c4ad9..a8cc362 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -96,6 +96,10 @@ protected: void on_show_projects(); void on_store_positions(); void on_view_toolbar(); + void on_zoom_in(); + void on_zoom_out(); + void on_zoom_normal(); + bool on_scroll(GdkEventScroll* ev); void zoom(double z); @@ -159,6 +163,9 @@ protected: Widget<Gtk::CheckMenuItem> _menu_view_projects; Widget<Gtk::MenuItem> _menu_view_refresh; Widget<Gtk::CheckMenuItem> _menu_view_toolbar; + Widget<Gtk::ImageMenuItem> _menu_zoom_in; + Widget<Gtk::ImageMenuItem> _menu_zoom_out; + Widget<Gtk::ImageMenuItem> _menu_zoom_normal; Widget<Gtk::Button> _messages_clear_but; Widget<Gtk::Button> _messages_close_but; Widget<Gtk::Dialog> _messages_win; diff --git a/src/patchage.glade b/src/patchage.glade index 8723616..e86a4b8 100644 --- a/src/patchage.glade +++ b/src/patchage.glade @@ -179,6 +179,43 @@ </widget> </child> <child> + <widget class="GtkSeparatorMenuItem" id="menuitem1"> + <property name="visible">True</property> + </widget> + </child> + <child> + <widget class="GtkImageMenuItem" id="menu_zoom_in"> + <property name="label">gtk-zoom-in</property> + <property name="visible">True</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="menu_zoom_out"> + <property name="label">gtk-zoom-out</property> + <property name="visible">True</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="menu_zoom_normal"> + <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="menuitem2"> + <property name="visible">True</property> + </widget> + </child> + <child> <widget class="GtkImageMenuItem" id="menu_view_refresh"> <property name="label">gtk-refresh</property> <property name="visible">True</property> |