diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-28 12:46:31 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-05-28 12:46:43 -0400 |
commit | 173b00777963376fd441256a4aadac9e6425af97 (patch) | |
tree | 73318ff1915b25aa1a5a6a2b0e3d372da18b02d0 /gtk2_ardour/ui_config.cc | |
parent | 34d19ce8792cd2ad7012bc4d74c5012f697d87f0 (diff) |
rearrange and redesign UIConfiguration/ARDOUR_UI APIs to allow correct initialization.
We need to be able to set an environment variable *before* gtk_init() is called, but also to
load the color theme right after gtk_init() and before the rest of the GUI is created.
Diffstat (limited to 'gtk2_ardour/ui_config.cc')
-rw-r--r-- | gtk2_ardour/ui_config.cc | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 1040c546ed..f34a5a48b6 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -78,10 +78,6 @@ UIConfiguration::UIConfiguration () ARDOUR_UI_UTILS::ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this)); ParameterChanged.connect (sigc::mem_fun (*this, &UIConfiguration::parameter_changed)); - - /* force GTK theme setting, so that loading an RC file will work */ - - load_color_theme (); } UIConfiguration::~UIConfiguration () @@ -152,6 +148,23 @@ UIConfiguration::map_parameters (boost::function<void (std::string)>& functor) } int +UIConfiguration::pre_gui_init () +{ + if (get_buggy_gradients()) { + g_setenv ("FORCE_BUGGY_GRADIENTS", "1", 1); + } + + return 0; +} + +UIConfiguration* +UIConfiguration::post_gui_init () +{ + load_color_theme (); + return this; +} + +int UIConfiguration::load_defaults () { std::string rcfile; @@ -177,13 +190,14 @@ UIConfiguration::load_defaults () warning << string_compose (_("Could not find default UI configuration file %1"), default_ui_config_file_name) << endmsg; } + if (ret == 0) { /* reload color theme */ load_color_theme (false); ARDOUR_UI_UTILS::ColorsChanged (); /* EMIT SIGNAL */ } - return 0; + return ret; } int |