summaryrefslogtreecommitdiff
path: root/gtk2_ardour/option_editor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-03-17 20:54:03 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-03-17 20:54:03 +0000
commit997e4b1f9cd7ccfc704b7c035051da7f60d831e7 (patch)
tree1236e40183b677abf4a2882e4cfe8e0a345eb24d /gtk2_ardour/option_editor.cc
parent19a4b990325577fc949ccd5d5fbad4520eb1df56 (diff)
merge with 2.0-ongoing @ rev 3147
git-svn-id: svn://localhost/ardour2/branches/3.0@3152 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r--gtk2_ardour/option_editor.cc37
1 files changed, 35 insertions, 2 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 988aa92e45..fd5c35e186 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -16,6 +16,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <pango/pangoft2.h> // for fontmap resolution control for GnomeCanvas
+#include <pango/pangocairo.h> // for fontmap resolution control for GnomeCanvas
#include <pbd/whitespace.h>
@@ -44,6 +46,7 @@
#include "option_editor.h"
#include "midi_port_dialog.h"
#include "gui_thread.h"
+#include "utils.h"
#include "i18n.h"
@@ -250,12 +253,40 @@ OptionEditor::add_session_paths ()
session_raid_entry.set_text(session->raid_path());
}
+static void
+font_scale_changed (Gtk::Adjustment* adj)
+{
+ Config->set_font_scale((long)floor (adj->get_value() * 1024));
+ reset_dpi();
+}
+
void
OptionEditor::setup_misc_options ()
{
Gtk::HBox* hbox;
-
- Label* label = manage (new Label (_("Short crossfade length (msecs)")));
+ Label* label;
+
+#ifndef GTKOSX
+ /* font scaling does nothing with GDK/Quartz */
+
+ Gtk::Adjustment* dpi_adj = new Gtk::Adjustment ((double)Config->get_font_scale() / 1024, 50, 250, 1, 10);
+ Gtk::HScale * dpi_range = new Gtk::HScale (*dpi_adj);
+
+ label = manage (new Label (_("Font Scaling")));
+ label->set_name ("OptionsLabel");
+
+ dpi_range->set_update_policy (Gtk::UPDATE_DISCONTINUOUS);
+ dpi_adj->signal_value_changed().connect (bind (sigc::ptr_fun (font_scale_changed), dpi_adj));
+
+ hbox = manage (new HBox);
+ hbox->set_border_width (5);
+ hbox->set_spacing (10);
+ hbox->pack_start (*label, false, false);
+ hbox->pack_start (*dpi_range, true, true);
+ misc_packer.pack_start (*hbox, false, false);
+#endif
+
+ label = manage (new Label (_("Short crossfade length (msecs)")));
label->set_name ("OptionsLabel");
hbox = manage (new HBox);
@@ -1345,5 +1376,7 @@ OptionEditor::parameter_changed (const char* parameter_name)
save_history_button.set_active (x);
saved_history_depth_spinner.set_sensitive (x);
+ } else if (PARAM_IS ("font-scale")) {
+ reset_dpi();
}
}