#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/cell_renderer_color_selector.h"
+#include "gtkmm2ext/utils.h"
#include "pbd/file_utils.h"
#include "pbd/compose.h"
#include "rgb_macros.h"
#include "ardour_ui.h"
#include "global_signals.h"
+#include "utils.h"
#include "i18n.h"
using namespace Gtk;
using namespace PBD;
using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
-sigc::signal<void> ColorsChanged;
-sigc::signal<void,uint32_t> ColorChanged;
+namespace ARDOUR_UI_UTILS {
+ sigc::signal<void> ColorsChanged;
+ sigc::signal<void,uint32_t> ColorChanged;
+}
ThemeManager::ThemeManager()
: ArdourWindow (_("Theme Manager"))
, timeline_item_gradient_depth (0, 1.0, 0.05)
, timeline_item_gradient_depth_label (_("Timeline item gradient depth"))
, all_dialogs (_("All floating windows are dialogs"))
+ , icon_set_label (_("Icon Set"))
{
set_title (_("Theme Manager"));
vbox->pack_start (region_color_button, PACK_SHRINK);
vbox->pack_start (show_clipping_button, PACK_SHRINK);
- Gtk::HBox* hbox = Gtk::manage (new Gtk::HBox());
+ Gtk::HBox* hbox;
+
+ vector<string> icon_sets = ::get_icon_sets ();
+
+ if (icon_sets.size() > 1) {
+ Gtkmm2ext::set_popdown_strings (icon_set_dropdown, icon_sets);
+ icon_set_dropdown.set_active_text (ARDOUR_UI::config()->get_icon_set());
+
+ hbox = Gtk::manage (new Gtk::HBox());
+ hbox->set_spacing (6);
+ hbox->pack_start (icon_set_label, false, false);
+ hbox->pack_start (icon_set_dropdown, true, true);
+ vbox->pack_start (*hbox, PACK_SHRINK);
+ }
+
+
+ hbox = Gtk::manage (new Gtk::HBox());
hbox->set_spacing (6);
hbox->pack_start (waveform_gradient_depth, true, true);
hbox->pack_start (waveform_gradient_depth_label, false, false);
hbox->set_spacing (6);
hbox->pack_start (timeline_item_gradient_depth, true, true);
hbox->pack_start (timeline_item_gradient_depth_label, false, false);
-
vbox->pack_start (*hbox, PACK_SHRINK);
+
vbox->pack_start (scroller);
vbox->show_all ();
waveform_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_waveform_gradient_depth_change));
timeline_item_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_timeline_item_gradient_depth_change));
all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
+ icon_set_dropdown.signal_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_icon_set_changed));
Gtkmm2ext::UI::instance()->set_tip (all_dialogs,
string_compose (_("Mark all floating windows to be type \"Dialog\" rather than using \"Utility\" for some.\n"
int cellx;
int celly;
- UIConfigVariable<uint32_t> *ccvar;
+ ColorVariable<uint32_t> *ccvar;
if (!color_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
return false;
case 1: /* color */
if ((iter = color_list->get_iter (path))) {
- UIConfigVariable<uint32_t>* var = (*iter)[columns.pVar];
+ ColorVariable<uint32_t>* var = (*iter)[columns.pVar];
if (!var) {
/* parent row, do nothing */
return false;
{
std::string rc_file_path;
- if (!find_file_in_search_path (ardour_config_search_path(), filename, rc_file_path)) {
+ if (!find_file (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"),
filename, ardour_config_search_path().to_string(), PROGRAM_NAME)
<< endmsg;
ARDOUR_UI::config()->set_dirty ();
}
+void
+ThemeManager::on_icon_set_changed ()
+{
+ string new_set = icon_set_dropdown.get_active_text();
+ ARDOUR_UI::config()->set_icon_set (new_set);
+}
+
void
ThemeManager::on_dark_theme_button_toggled()
{
color_list->clear();
- for (std::map<std::string,UIConfigVariable<uint32_t> *>::iterator i = ARDOUR_UI::config()->canvas_colors.begin(); i != ARDOUR_UI::config()->canvas_colors.end(); i++) {
+ for (std::map<std::string,ColorVariable<uint32_t> *>::iterator i = ARDOUR_UI::config()->canvas_colors.begin(); i != ARDOUR_UI::config()->canvas_colors.end(); i++) {
- UIConfigVariable<uint32_t>* var = i->second;
+ ColorVariable<uint32_t>* var = i->second;
TreeModel::Children rows = color_list->children();
TreeModel::Row row;