summaryrefslogtreecommitdiffstats
path: root/src/Patchage.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-03-30 20:12:48 +0000
committerDavid Robillard <d@drobilla.net>2014-03-30 20:12:48 +0000
commit2a37c8279d54e41242dca7ffb9c5019d56b01145 (patch)
tree7c0335ce0fe2935a5c4c68254720650994bac2e4 /src/Patchage.cpp
parentedc149fe5a8fca653b0201bf0449c0392daae03e (diff)
downloadpatchage-2a37c8279d54e41242dca7ffb9c5019d56b01145.tar.gz
patchage-2a37c8279d54e41242dca7ffb9c5019d56b01145.tar.bz2
patchage-2a37c8279d54e41242dca7ffb9c5019d56b01145.zip
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
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r--src/Patchage.cpp31
1 files changed, 29 insertions, 2 deletions
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
@@ -626,6 +635,24 @@ Patchage::on_zoom_normal()
}
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()
{
_status_text->get_buffer()->erase(