From 2a37c8279d54e41242dca7ffb9c5019d56b01145 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Mar 2014 20:12:48 +0000 Subject: Reimplement canvas zoom. Make select rectangle translucent. Make ctrl+scroll wheel zoom, not change font size. Add separate controls in Patchage for zoom (scale) and font size. Banish canvas coordinates from item implementations. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@5345 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/Patchage.cpp') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index efc2c6b..e76a8d5 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -104,6 +104,9 @@ Patchage::Patchage(int argc, char** argv) , INIT_WIDGET(_menu_zoom_in) , INIT_WIDGET(_menu_zoom_out) , INIT_WIDGET(_menu_zoom_normal) + , INIT_WIDGET(_menu_increase_font_size) + , INIT_WIDGET(_menu_decrease_font_size) + , INIT_WIDGET(_menu_normal_font_size) , INIT_WIDGET(_messages_clear_but) , INIT_WIDGET(_messages_close_but) , INIT_WIDGET(_messages_win) @@ -199,6 +202,12 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::on_zoom_out)); _menu_zoom_normal->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_zoom_normal)); + _menu_increase_font_size->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_increase_font_size)); + _menu_decrease_font_size->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_decrease_font_size)); + _menu_normal_font_size->signal_activate().connect( + sigc::mem_fun(this, &Patchage::on_normal_font_size)); _messages_clear_but->signal_clicked().connect( sigc::mem_fun(this, &Patchage::on_messages_clear)); @@ -610,13 +619,13 @@ Patchage::on_help_about() void Patchage::on_zoom_in() { - _canvas->set_font_size(_canvas->get_font_size() + 1.0); + _canvas->set_zoom(_canvas->get_zoom() + 0.1); } void Patchage::on_zoom_out() { - _canvas->set_font_size(_canvas->get_font_size() - 1.0); + _canvas->set_zoom(_canvas->get_zoom() - 0.1); } void @@ -625,6 +634,24 @@ Patchage::on_zoom_normal() _canvas->set_zoom(1.0); } +void +Patchage::on_increase_font_size() +{ + _canvas->set_font_size(_canvas->get_font_size() + 1.0); +} + +void +Patchage::on_decrease_font_size() +{ + _canvas->set_font_size(_canvas->get_font_size() - 1.0); +} + +void +Patchage::on_normal_font_size() +{ + _canvas->set_font_size(_canvas->get_default_font_size()); +} + void Patchage::on_messages_clear() { -- cgit v1.2.1