From cfc8a2c263e00eaf2d09d1e7c92cff3d0f61be13 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 26 Aug 2019 18:58:34 +0200 Subject: Push UI theme to backend, LV2 plugin options --- gtk2_ardour/ardour_ui.cc | 6 ++++-- gtk2_ardour/ardour_ui.h | 2 +- gtk2_ardour/ardour_ui_ed.cc | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index fcccca3fe6..999726c438 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -471,6 +471,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) Config->ParameterChanged.connect ( forever_connections, MISSING_INVALIDATOR, boost::bind(&ARDOUR_UI::set_flat_buttons, this), gui_context() ); set_flat_buttons(); + theme_changed.connect (sigc::mem_fun(*this, &ARDOUR_UI::on_theme_changed)); + UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::on_theme_changed)); + UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::on_theme_changed)); + /* lets get this party started */ setup_gtk_ardour_enums (); @@ -539,8 +543,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir) _process_thread = new ProcessThread (); _process_thread->init (); - UIConfiguration::instance().DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets)); - attach_to_engine (); } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index eb71cb87a0..39c0546a7e 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -844,7 +844,7 @@ private: ArdourLogLevel _log_not_acknowledged; - void resize_text_widgets (); + void on_theme_changed (); bool xrun_button_release (GdkEventButton* ev); diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 3062836f34..b7bf68ce28 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -75,6 +75,7 @@ #include "ardour/session.h" #include "ardour/profile.h" #include "ardour/audioengine.h" +#include "ardour/lv2_plugin.h" #include "control_protocol/control_protocol.h" @@ -889,8 +890,11 @@ ARDOUR_UI::save_ardour_state () } void -ARDOUR_UI::resize_text_widgets () +ARDOUR_UI::on_theme_changed () { + LV2Plugin::set_global_ui_background_color (UIConfiguration::instance().color ("gtk_background")); + LV2Plugin::set_global_ui_foreground_color (UIConfiguration::instance().color ("gtk_foreground")); + LV2Plugin::set_global_ui_scale_factor (UIConfiguration::instance().get_ui_scale()); } void -- cgit v1.2.3