summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ui_config.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-06-19 11:18:37 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-19 11:18:44 -0400
commit01df705f701a115c017ca23ee21ff64d8d49bfe2 (patch)
treec4adbb49cc283f0852c156b01f1e63d6c24a7060 /gtk2_ardour/ui_config.h
parent280fc81e05f885c1259ec6513297507b9e6c87b2 (diff)
change the way font specifications are used in UI config files
If no font family is specified, enforce use of Sans to match GTK behaviour (which we inadvertently relied on, it appears)
Diffstat (limited to 'gtk2_ardour/ui_config.h')
-rw-r--r--gtk2_ardour/ui_config.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h
index ec9e1ad940..a5bba2c87c 100644
--- a/gtk2_ardour/ui_config.h
+++ b/gtk2_ardour/ui_config.h
@@ -28,6 +28,8 @@
#include "pbd/xml++.h"
#include "ardour/configuration_variable.h"
+#include "utils.h"
+
/* This is very similar to ARDOUR::ConfigVariable but expects numeric values to
* be in hexadecimal. This is because it is intended for use with color
* specifications which are easier to scan for issues in "rrggbbaa" format than
@@ -113,9 +115,13 @@ class UIConfiguration : public PBD::Stateful
#define CANVAS_STRING_VARIABLE(var,name) \
std::string get_##var () const { return var.get(); } \
bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
+#define CANVAS_FONT_VARIABLE(var,name) \
+ Pango::FontDescription get_##var () const { return sanitized_font (var.get()); } \
+ bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
#include "canvas_vars.h"
#undef CANVAS_VARIABLE
#undef CANVAS_STRING_VARIABLE
+#undef CANVAS_FONT_VARIABLE
private:
@@ -129,9 +135,11 @@ class UIConfiguration : public PBD::Stateful
#undef CANVAS_VARIABLE
#define CANVAS_VARIABLE(var,name) ColorVariable<uint32_t> var;
#define CANVAS_STRING_VARIABLE(var,name) ARDOUR::ConfigVariable<std::string> var;
+#define CANVAS_FONT_VARIABLE(var,name) ARDOUR::ConfigVariable<std::string> var;
#include "canvas_vars.h"
#undef CANVAS_VARIABLE
#undef CANVAS_STRING_VARIABLE
+#undef CANVAS_FONT_VARIABLE
XMLNode& state ();
bool _dirty;