add mixbus profile which removes the tearoffs
[ardour.git] / gtk2_ardour / theme_manager.cc
index 3514d918bd051e360a07743eefe69de04ff9a754..38f8aac4c91b1a2dbe18a2832b772a50d8f5e325 100644 (file)
@@ -29,6 +29,7 @@
 
 #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"
@@ -42,6 +43,7 @@
 #include "rgb_macros.h"
 #include "ardour_ui.h"
 #include "global_signals.h"
+#include "utils.h"
 
 #include "i18n.h"
 
@@ -49,9 +51,12 @@ using namespace std;
 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"))
@@ -66,6 +71,7 @@ ThemeManager::ThemeManager()
        , 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"));
 
@@ -107,7 +113,23 @@ ThemeManager::ThemeManager()
        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);
@@ -117,8 +139,8 @@ ThemeManager::ThemeManager()
        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 ();
@@ -148,6 +170,7 @@ ThemeManager::ThemeManager()
        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"
@@ -177,7 +200,7 @@ ThemeManager::button_press_event (GdkEventButton* ev)
        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;
@@ -191,7 +214,7 @@ ThemeManager::button_press_event (GdkEventButton* ev)
        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;
@@ -255,7 +278,7 @@ load_rc_file (const string& filename, bool themechange)
 {
        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;
@@ -329,6 +352,13 @@ ThemeManager::on_timeline_item_gradient_depth_change ()
        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()
 {
@@ -365,10 +395,10 @@ ThemeManager::setup_theme ()
 
        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;