summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Patchage.cpp31
-rw-r--r--src/Patchage.hpp6
-rw-r--r--src/patchage.ui39
3 files changed, 74 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(
diff --git a/src/Patchage.hpp b/src/Patchage.hpp
index 54399bc..5a09e74 100644
--- a/src/Patchage.hpp
+++ b/src/Patchage.hpp
@@ -98,6 +98,9 @@ protected:
void on_zoom_in();
void on_zoom_out();
void on_zoom_normal();
+ void on_increase_font_size();
+ void on_decrease_font_size();
+ void on_normal_font_size();
bool on_scroll(GdkEventScroll* ev);
@@ -149,6 +152,9 @@ protected:
Widget<Gtk::ImageMenuItem> _menu_zoom_in;
Widget<Gtk::ImageMenuItem> _menu_zoom_out;
Widget<Gtk::ImageMenuItem> _menu_zoom_normal;
+ Widget<Gtk::MenuItem> _menu_increase_font_size;
+ Widget<Gtk::MenuItem> _menu_decrease_font_size;
+ Widget<Gtk::MenuItem> _menu_normal_font_size;
Widget<Gtk::Button> _messages_clear_but;
Widget<Gtk::Button> _messages_close_but;
Widget<Gtk::Dialog> _messages_win;
diff --git a/src/patchage.ui b/src/patchage.ui
index 8dd0138..c34fa32 100644
--- a/src/patchage.ui
+++ b/src/patchage.ui
@@ -945,6 +945,45 @@ Nedko Arnaudov &lt;nedko@arnaudov.name&gt;</property>
</object>
</child>
<child>
+ <object class="GtkMenuItem" id="menu_increase_font_size">
+ <property name="label" translatable="yes">_Increase Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="I" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menu_decrease_font_size">
+ <property name="label" translatable="yes">_Decrease Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="D" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkMenuItem" id="menu_normal_font_size">
+ <property name="label" translatable="yes">_Normal Font Size</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <accelerator key="N" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSeparatorMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ <child>
<object class="GtkImageMenuItem" id="menu_view_refresh">
<property name="label">gtk-refresh</property>
<property name="use_action_appearance">False</property>