move theme manager into preferences window

This commit is contained in:
Paul Davis 2014-12-15 12:32:41 -05:00
parent 8b23001441
commit f6e88ead01
10 changed files with 40 additions and 43 deletions

View file

@ -505,7 +505,6 @@
<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'/>

View 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 ();

View 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;

View 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();

View 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

View 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)
{

View 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:

View 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

View 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);
pack_start (notebook);
vbox->show_all ();
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));
}

View 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();