move theme manager into preferences window
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 15 Dec 2014 17:32:41 +0000 (12:32 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 15 Dec 2014 17:32:41 +0000 (12:32 -0500)
gtk2_ardour/ardour.menus.in
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/mnemonic-us.bindings.in
gtk2_ardour/option_editor.cc
gtk2_ardour/option_editor.h
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/theme_manager.cc
gtk2_ardour/theme_manager.h

index d7bd5eac7b04cfce1e3f1fa9b22f37d9651b4a4e..d4b65025c69c49472d3083d3e7c413b26c73a102 100644 (file)
       <menuitem action='toggle-locations'/>
       <menuitem action='toggle-key-editor'/>
       <menuitem action='toggle-bundle-manager'/>
-      <menuitem action='toggle-theme-manager'/>
       <menuitem action='toggle-big-clock'/>
 #if 0
       <menuitem action='toggle-speaker-config'/>
index f4c5bdd81c11cc8b799df8a7a21184e49f3f9b36..3ee75926fadd301e340ba3a0951a71c695ef0184 100644 (file)
@@ -202,7 +202,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        , editor_meter_peak_display()
 
        , speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
-       , theme_manager (X_("theme-manager"), _("Theme Manager"))
        , key_editor (X_("key-editor"), _("Key Bindings"))
        , rc_option_editor (X_("rc-options-editor"), _("Preferences"))
        , add_route_dialog (X_("add-routes"), _("Add Tracks/Busses"))
@@ -349,7 +348,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        const XMLNode* ui_xml = Config->extra_xml (X_("UI"));
 
        if (ui_xml) {
-               theme_manager.set_state (*ui_xml);
                key_editor.set_state (*ui_xml);
                rc_option_editor.set_state (*ui_xml);
                session_option_editor.set_state (*ui_xml);
@@ -365,7 +363,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
                midi_port_matrix.set_state (*ui_xml);
        }
 
-       WM::Manager::instance().register_window (&theme_manager);
        WM::Manager::instance().register_window (&key_editor);
        WM::Manager::instance().register_window (&rc_option_editor);
        WM::Manager::instance().register_window (&session_option_editor);
@@ -381,12 +378,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        WM::Manager::instance().register_window (&audio_port_matrix);
        WM::Manager::instance().register_window (&midi_port_matrix);
 
-       /* We need to instantiate the theme manager because it loads our
-          theme files. This should really change so that its window
-          and its functionality are separate 
-       */
-       
-       (void) theme_manager.get (true);
+       /* Trigger setting up the color scheme and loading the GTK RC file */
+
+       ARDOUR_UI::config()->load_rc_file (false);
        
        _process_thread = new ProcessThread ();
        _process_thread->init ();
index f752295f7892b9503aff8bf32a5b8b21d0576867..bd266a0f806ac863599707a03a945730d6c7c529 100644 (file)
@@ -90,8 +90,6 @@
 #include "route_params_ui.h"
 #include "session_option_editor.h"
 #include "speaker_dialog.h"
-#include "theme_manager.h"
-
 
 class VideoTimeLine;
 class ArdourKeyboard;
@@ -628,7 +626,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
         /* Dialogs that can be created via new<T> */
 
         WM::Proxy<SpeakerDialog> speaker_config_window;
-        WM::Proxy<ThemeManager> theme_manager;
         WM::Proxy<KeyEditor> key_editor;
         WM::Proxy<RCOptionEditor> rc_option_editor;
         WM::Proxy<AddRouteDialog> add_route_dialog;
index 654525358264ca2551b71ad641a62ddaf64b8eee..979e2f487cc52e6ce0c5b5f42ef6e01bf2240b9b 100644 (file)
@@ -280,7 +280,6 @@ ARDOUR_UI::unload_session (bool hide_stuff)
                editor->hide ();
                mixer->hide ();
                meterbridge->hide ();
-               theme_manager->hide ();
                audio_port_matrix->hide();
                midi_port_matrix->hide();
                route_params->hide();
index 703ff7a5857a93785eb65186c9368f6366c7758b..8c3126315fe14bd74b7a50883b2767cbc1e84a9f 100644 (file)
@@ -216,7 +216,6 @@ This mode provides many different operations on both regions and control points,
 ;@-group|Editor/crop|c|some text
 @mmode|MouseMode/set-mouse-mode-cut|c|cut mode
 @edit|Editor/editor-copy|<@PRIMARY@>c|copy
-@wvis|Window/toggle-theme-manager|<@WINDOW@>c|toggle color manager
 @rop|Region/set-region-sync-position|v|set region sync point
 @edit|Editor/editor-paste|<@PRIMARY@>v|paste
 @-group|Editor/brush-at-mouse|<@PRIMARY@>b|some text
index 137d6b98c8a5bf8117656476d800f79351333257..aa975b6b94693df07e03706aaea8b22de655c168 100644 (file)
@@ -445,6 +445,21 @@ OptionEditor::add_option (std::string const & pn, OptionEditorComponent* o)
        o->set_state_from_config ();
 }
 
+/** Add a new page 
+ *  @param pn Page name (will be created if it doesn't already exist)
+ *  @param w widget that fills the page
+ */
+void
+OptionEditor::add_page (std::string const & pn, Gtk::Widget& w)
+{
+       if (_pages.find (pn) == _pages.end()) {
+               _pages[pn] = new OptionEditorPage (_notebook, pn);
+       }
+
+       OptionEditorPage* p = _pages[pn];
+       p->box.pack_start (w, true, true);
+}
+
 void
 OptionEditor::set_current_page (string const & p)
 {
index 4e3269e43ce208f35d6514ecdbc4a8302db84e48..cb5f76f31d4d0be2850c86161ed4c86530c3e254 100644 (file)
@@ -651,7 +651,8 @@ public:
        ~OptionEditor ();
 
        void add_option (std::string const &, OptionEditorComponent *);
-
+       void add_page (std::string const &, Gtk::Widget& page_widget);
+       
        void set_current_page (std::string const &);
 
 protected:
index 716918f3a651a0ad9bcd0b98895f4458435d6166..5646602e4cd09b0fdf8c1726586b7ae7168a9565 100644 (file)
@@ -54,6 +54,7 @@
 #include "midi_port_dialog.h"
 #include "sfdb_ui.h"
 #include "keyboard.h"
+#include "theme_manager.h"
 #include "i18n.h"
 
 using namespace std;
@@ -2336,6 +2337,10 @@ RCOptionEditor::RCOptionEditor ()
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_style_led)
                     ));
 
+       /* and now the theme manager */
+
+       ThemeManager* tm = manage (new ThemeManager);
+       add_page (_("Theme"), *tm);
 }
 
 void
index 958d952d070d103e13e455fffa52743e4a1c7d44..8a362d17ba1e5de0c21a24746fa5315fd51dd2e3 100644 (file)
@@ -62,8 +62,7 @@ namespace ARDOUR_UI_UTILS {
 }
 
 ThemeManager::ThemeManager()
-       : ArdourWindow (_("Theme Manager"))
-       , dark_button (_("Dark Theme"))
+        : dark_button (_("Dark Theme"))
        , light_button (_("Light Theme"))
        , reset_button (_("Restore Defaults"))
        , flat_buttons (_("Draw \"flat\" buttons"))
@@ -80,8 +79,6 @@ ThemeManager::ThemeManager()
        , palette_group (0)
        , palette_window (0)
 {
-       set_title (_("Theme Manager"));
-
        /* Now the alias list */
        
        alias_list = TreeStore::create (alias_columns);
@@ -113,17 +110,16 @@ ThemeManager::ThemeManager()
        theme_selection_hbox.pack_start (dark_button);
        theme_selection_hbox.pack_start (light_button);
 
-       Gtk::VBox* vbox = Gtk::manage (new Gtk::VBox ());
-       vbox->set_homogeneous (false);
-       vbox->pack_start (theme_selection_hbox, PACK_SHRINK);
-       vbox->pack_start (reset_button, PACK_SHRINK);
+       set_homogeneous (false);
+       pack_start (theme_selection_hbox, PACK_SHRINK);
+       pack_start (reset_button, PACK_SHRINK);
 #ifndef __APPLE__
-       vbox->pack_start (all_dialogs, PACK_SHRINK);
+       pack_start (all_dialogs, PACK_SHRINK);
 #endif
-       vbox->pack_start (flat_buttons, PACK_SHRINK);
-       vbox->pack_start (blink_rec_button, PACK_SHRINK);
-       vbox->pack_start (region_color_button, PACK_SHRINK);
-       vbox->pack_start (show_clipping_button, PACK_SHRINK);
+       pack_start (flat_buttons, PACK_SHRINK);
+       pack_start (blink_rec_button, PACK_SHRINK);
+       pack_start (region_color_button, PACK_SHRINK);
+       pack_start (show_clipping_button, PACK_SHRINK);
 
        Gtk::HBox* hbox;
 
@@ -137,7 +133,7 @@ ThemeManager::ThemeManager()
                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);
+               pack_start (*hbox, PACK_SHRINK);
        }
 
        
@@ -145,13 +141,13 @@ ThemeManager::ThemeManager()
        hbox->set_spacing (6);
        hbox->pack_start (waveform_gradient_depth, true, true);
        hbox->pack_start (waveform_gradient_depth_label, false, false);
-       vbox->pack_start (*hbox, PACK_SHRINK);
+       pack_start (*hbox, PACK_SHRINK);
 
        hbox = Gtk::manage (new Gtk::HBox());
        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);
+       pack_start (*hbox, PACK_SHRINK);
 
        palette_group = initialize_palette_canvas (*palette_viewport.canvas());
        palette_viewport.signal_size_allocate().connect (sigc::bind (sigc::mem_fun (*this, &ThemeManager::palette_canvas_allocated), palette_group, palette_viewport.canvas(),
@@ -164,11 +160,9 @@ ThemeManager::ThemeManager()
        notebook.append_page (palette_scroller, _("Palette"));
        notebook.append_page (modifier_scroller, _("Modifiers"));
        
-       vbox->pack_start (notebook);
-
-       vbox->show_all ();
+       pack_start (notebook);
 
-       add (*vbox);
+       show_all ();
 
        waveform_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED);
        timeline_item_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED);
@@ -205,10 +199,6 @@ ThemeManager::ThemeManager()
        setup_aliases ();
        setup_modifiers ();
        
-       /* Trigger setting up the color scheme and loading the GTK RC file */
-
-       ARDOUR_UI::config()->load_rc_file (false);
-
        ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
 }
 
index e9a12b185e0e2b136ed5fe80fdc3870554603048..87c66cf1ed3bca37015bbb5f639419c980a528be 100644 (file)
@@ -32,8 +32,6 @@
 #include "canvas/types.h"
 #include "canvas/canvas.h"
 
-#include "ardour_window.h"
-
 #include "ui_config.h"
 
 namespace ArdourCanvas {
@@ -43,7 +41,7 @@ namespace ArdourCanvas {
 
 class ArdourDialog;
 
-class ThemeManager : public ArdourWindow
+class ThemeManager : public Gtk::VBox
 {
   public:
        ThemeManager();