#include "gtkmm2ext/cell_renderer_color_selector.h"
#include "pbd/file_utils.h"
+#include "pbd/compose.h"
#include "ardour/filesystem_paths.h"
#include "ardour_button.h"
+#include "canvas-waveview.h"
#include "theme_manager.h"
#include "rgb_macros.h"
#include "ardour_ui.h"
, light_button (_("Light Theme"))
, reset_button (_("Restore Defaults"))
, flat_buttons (_("Draw \"flat\" buttons"))
+ , all_dialogs (_("All floating windows are dialogs"))
+ , gradient_waveforms (_("Draw waveforms with color gradient"))
{
set_title (_("Theme Manager"));
vbox->set_homogeneous (false);
vbox->pack_start (theme_selection_hbox, PACK_SHRINK);
vbox->pack_start (reset_button, PACK_SHRINK);
+#ifndef __APPLE__
+ vbox->pack_start (all_dialogs, PACK_SHRINK);
+#endif
vbox->pack_start (flat_buttons, PACK_SHRINK);
+ vbox->pack_start (gradient_waveforms, PACK_SHRINK);
vbox->pack_start (scroller);
+
+ vbox->show_all ();
+
add (*vbox);
color_display.signal_button_press_event().connect (sigc::mem_fun (*this, &ThemeManager::button_press_event), false);
light_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_light_theme_button_toggled));
reset_button.signal_clicked().connect (sigc::mem_fun (*this, &ThemeManager::reset_canvas_colors));
flat_buttons.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_flat_buttons_toggled));
+ all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
+ gradient_waveforms.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_gradient_waveforms_toggled));
+
+ Gtkmm2ext::UI::instance()->set_tip (all_dialogs,
+ string_compose (_("Mark all floating windows to be type \"Dialog\" rather than using \"Utility\" for some.\n"
+ "This may help with some window managers. This requires a restart of %1 to take effect"),
+ PROGRAM_NAME));
set_size_request (-1, 400);
setup_theme ();
ccvar = (*iter)[columns.pVar];
ccvar->set(rgba);
+ /* mark dirty ... */
ARDOUR_UI::config()->set_dirty ();
+ /* but save it immediately */
+ ARDOUR_UI::config()->save_state ();
ColorsChanged(); //EMIT SIGNAL
break;
void
load_rc_file (const string& filename, bool themechange)
{
- sys::path rc_file_path;
+ std::string rc_file_path;
if (!find_file_in_search_path (ardour_config_search_path(), filename, rc_file_path)) {
warning << string_compose (_("Unable to find UI style file %1 in search path %2. %3 will look strange"),
return;
}
- info << "Loading ui configuration file " << rc_file_path.to_string() << endmsg;
+ info << "Loading ui configuration file " << rc_file_path << endmsg;
- Gtkmm2ext::UI::instance()->load_rcfile (rc_file_path.to_string(), themechange);
+ Gtkmm2ext::UI::instance()->load_rcfile (rc_file_path, themechange);
}
/* hmm, this is a problem. the profile doesn't
gtk_rc_reset_styles (gtk_settings_get_default());
}
+void
+ThemeManager::on_all_dialogs_toggled ()
+{
+ ARDOUR_UI::config()->all_floating_windows_are_dialogs.set (all_dialogs.get_active());
+ ARDOUR_UI::config()->set_dirty ();
+}
+
+void
+ThemeManager::on_gradient_waveforms_toggled ()
+{
+ ARDOUR_UI::config()->gradient_waveforms.set (gradient_waveforms.get_active());
+ ARDOUR_UI::config()->set_dirty ();
+
+ gnome_canvas_waveview_set_gradient_waveforms (gradient_waveforms.get_active());
+
+ /* force a redraw */
+ gtk_rc_reset_styles (gtk_settings_get_default());
+}
+
void
ThemeManager::on_dark_theme_button_toggled()
{
}
flat_buttons.set_active (ARDOUR_UI::config()->flat_buttons.get());
+ all_dialogs.set_active (ARDOUR_UI::config()->all_floating_windows_are_dialogs.get());
+ gradient_waveforms.set_active (ARDOUR_UI::config()->gradient_waveforms.get());
load_rc_file(rcfile, false);
}
{
ARDOUR_UI::config()->load_defaults();
setup_theme ();
+ /* mark dirty ... */
+ ARDOUR_UI::config()->set_dirty ();
+ /* but save it immediately */
+ ARDOUR_UI::config()->save_state ();
}