}
void
-load_rc_file (const string& filename)
+load_rc_file (const string& filename, bool themechange)
{
sys::path rc_file_path;
info << "Loading ui configuration file " << rc_file_path.to_string() << endmsg;
- Gtkmm2ext::UI::instance()->load_rcfile (rc_file_path.to_string());
+ Gtkmm2ext::UI::instance()->load_rcfile (rc_file_path.to_string(), themechange);
}
void
if (!dark_button.get_active()) return;
ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_dark.rc");
- load_rc_file (ARDOUR_UI::config()->ui_rc_file.get());
+ load_rc_file (ARDOUR_UI::config()->ui_rc_file.get(), true);
}
void
if (!light_button.get_active()) return;
ARDOUR_UI::config()->ui_rc_file.set("ardour2_ui_light.rc");
- load_rc_file (ARDOUR_UI::config()->ui_rc_file.get());
+ load_rc_file (ARDOUR_UI::config()->ui_rc_file.get(), true);
}
void
light_button.set_active();
}
- load_rc_file(rcfile);
+ load_rc_file(rcfile, false);
}
}
int
-UI::load_rcfile (string path)
+UI::load_rcfile (string path, bool themechange)
{
if (path.length() == 0) {
return -1;
}
RC rc (path.c_str());
+ RC::reset_styles(Gtk::Settings::get_default());
+ theme_changed.emit();
+
+ if (themechange) {
+ return 0; //Don't continue on every time there is a theme change
+ }
/* have to pack widgets into a toplevel window so that styles will stick */
info_mtag->property_foreground_gdk().set_value(style->get_fg(STATE_NORMAL));
info_mtag->property_background_gdk().set_value(style->get_bg(STATE_NORMAL));
-
- RC::reset_styles(Gtk::Settings::get_default());
-
- theme_changed.emit();
-
return 0;
}
bool running ();
void quit ();
void kill ();
- int load_rcfile (string);
+ int load_rcfile (string, bool themechange = false);
void run (Receiver &old_receiver);
void set_state (Gtk::Widget *w, Gtk::StateType state);