mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
move theme manager into preferences window
This commit is contained in:
parent
8b23001441
commit
f6e88ead01
10 changed files with 40 additions and 43 deletions
|
|
@ -505,7 +505,6 @@
|
||||||
<menuitem action='toggle-locations'/>
|
<menuitem action='toggle-locations'/>
|
||||||
<menuitem action='toggle-key-editor'/>
|
<menuitem action='toggle-key-editor'/>
|
||||||
<menuitem action='toggle-bundle-manager'/>
|
<menuitem action='toggle-bundle-manager'/>
|
||||||
<menuitem action='toggle-theme-manager'/>
|
|
||||||
<menuitem action='toggle-big-clock'/>
|
<menuitem action='toggle-big-clock'/>
|
||||||
#if 0
|
#if 0
|
||||||
<menuitem action='toggle-speaker-config'/>
|
<menuitem action='toggle-speaker-config'/>
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
, editor_meter_peak_display()
|
, editor_meter_peak_display()
|
||||||
|
|
||||||
, speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
|
, speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
|
||||||
, theme_manager (X_("theme-manager"), _("Theme Manager"))
|
|
||||||
, key_editor (X_("key-editor"), _("Key Bindings"))
|
, key_editor (X_("key-editor"), _("Key Bindings"))
|
||||||
, rc_option_editor (X_("rc-options-editor"), _("Preferences"))
|
, rc_option_editor (X_("rc-options-editor"), _("Preferences"))
|
||||||
, add_route_dialog (X_("add-routes"), _("Add Tracks/Busses"))
|
, 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"));
|
const XMLNode* ui_xml = Config->extra_xml (X_("UI"));
|
||||||
|
|
||||||
if (ui_xml) {
|
if (ui_xml) {
|
||||||
theme_manager.set_state (*ui_xml);
|
|
||||||
key_editor.set_state (*ui_xml);
|
key_editor.set_state (*ui_xml);
|
||||||
rc_option_editor.set_state (*ui_xml);
|
rc_option_editor.set_state (*ui_xml);
|
||||||
session_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);
|
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 (&key_editor);
|
||||||
WM::Manager::instance().register_window (&rc_option_editor);
|
WM::Manager::instance().register_window (&rc_option_editor);
|
||||||
WM::Manager::instance().register_window (&session_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 (&audio_port_matrix);
|
||||||
WM::Manager::instance().register_window (&midi_port_matrix);
|
WM::Manager::instance().register_window (&midi_port_matrix);
|
||||||
|
|
||||||
/* We need to instantiate the theme manager because it loads our
|
/* Trigger setting up the color scheme and loading the GTK RC file */
|
||||||
theme files. This should really change so that its window
|
|
||||||
and its functionality are separate
|
|
||||||
*/
|
|
||||||
|
|
||||||
(void) theme_manager.get (true);
|
ARDOUR_UI::config()->load_rc_file (false);
|
||||||
|
|
||||||
_process_thread = new ProcessThread ();
|
_process_thread = new ProcessThread ();
|
||||||
_process_thread->init ();
|
_process_thread->init ();
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,6 @@
|
||||||
#include "route_params_ui.h"
|
#include "route_params_ui.h"
|
||||||
#include "session_option_editor.h"
|
#include "session_option_editor.h"
|
||||||
#include "speaker_dialog.h"
|
#include "speaker_dialog.h"
|
||||||
#include "theme_manager.h"
|
|
||||||
|
|
||||||
|
|
||||||
class VideoTimeLine;
|
class VideoTimeLine;
|
||||||
class ArdourKeyboard;
|
class ArdourKeyboard;
|
||||||
|
|
@ -628,7 +626,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
/* Dialogs that can be created via new<T> */
|
/* Dialogs that can be created via new<T> */
|
||||||
|
|
||||||
WM::Proxy<SpeakerDialog> speaker_config_window;
|
WM::Proxy<SpeakerDialog> speaker_config_window;
|
||||||
WM::Proxy<ThemeManager> theme_manager;
|
|
||||||
WM::Proxy<KeyEditor> key_editor;
|
WM::Proxy<KeyEditor> key_editor;
|
||||||
WM::Proxy<RCOptionEditor> rc_option_editor;
|
WM::Proxy<RCOptionEditor> rc_option_editor;
|
||||||
WM::Proxy<AddRouteDialog> add_route_dialog;
|
WM::Proxy<AddRouteDialog> add_route_dialog;
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,6 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
||||||
editor->hide ();
|
editor->hide ();
|
||||||
mixer->hide ();
|
mixer->hide ();
|
||||||
meterbridge->hide ();
|
meterbridge->hide ();
|
||||||
theme_manager->hide ();
|
|
||||||
audio_port_matrix->hide();
|
audio_port_matrix->hide();
|
||||||
midi_port_matrix->hide();
|
midi_port_matrix->hide();
|
||||||
route_params->hide();
|
route_params->hide();
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,6 @@ This mode provides many different operations on both regions and control points,
|
||||||
;@-group|Editor/crop|c|some text
|
;@-group|Editor/crop|c|some text
|
||||||
@mmode|MouseMode/set-mouse-mode-cut|c|cut mode
|
@mmode|MouseMode/set-mouse-mode-cut|c|cut mode
|
||||||
@edit|Editor/editor-copy|<@PRIMARY@>c|copy
|
@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
|
@rop|Region/set-region-sync-position|v|set region sync point
|
||||||
@edit|Editor/editor-paste|<@PRIMARY@>v|paste
|
@edit|Editor/editor-paste|<@PRIMARY@>v|paste
|
||||||
@-group|Editor/brush-at-mouse|<@PRIMARY@>b|some text
|
@-group|Editor/brush-at-mouse|<@PRIMARY@>b|some text
|
||||||
|
|
|
||||||
|
|
@ -445,6 +445,21 @@ OptionEditor::add_option (std::string const & pn, OptionEditorComponent* o)
|
||||||
o->set_state_from_config ();
|
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
|
void
|
||||||
OptionEditor::set_current_page (string const & p)
|
OptionEditor::set_current_page (string const & p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -651,6 +651,7 @@ public:
|
||||||
~OptionEditor ();
|
~OptionEditor ();
|
||||||
|
|
||||||
void add_option (std::string const &, OptionEditorComponent *);
|
void add_option (std::string const &, OptionEditorComponent *);
|
||||||
|
void add_page (std::string const &, Gtk::Widget& page_widget);
|
||||||
|
|
||||||
void set_current_page (std::string const &);
|
void set_current_page (std::string const &);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@
|
||||||
#include "midi_port_dialog.h"
|
#include "midi_port_dialog.h"
|
||||||
#include "sfdb_ui.h"
|
#include "sfdb_ui.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
|
#include "theme_manager.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
@ -2336,6 +2337,10 @@ RCOptionEditor::RCOptionEditor ()
|
||||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_style_led)
|
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
|
void
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ namespace ARDOUR_UI_UTILS {
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeManager::ThemeManager()
|
ThemeManager::ThemeManager()
|
||||||
: ArdourWindow (_("Theme Manager"))
|
: dark_button (_("Dark Theme"))
|
||||||
, dark_button (_("Dark Theme"))
|
|
||||||
, light_button (_("Light Theme"))
|
, light_button (_("Light Theme"))
|
||||||
, reset_button (_("Restore Defaults"))
|
, reset_button (_("Restore Defaults"))
|
||||||
, flat_buttons (_("Draw \"flat\" buttons"))
|
, flat_buttons (_("Draw \"flat\" buttons"))
|
||||||
|
|
@ -80,8 +79,6 @@ ThemeManager::ThemeManager()
|
||||||
, palette_group (0)
|
, palette_group (0)
|
||||||
, palette_window (0)
|
, palette_window (0)
|
||||||
{
|
{
|
||||||
set_title (_("Theme Manager"));
|
|
||||||
|
|
||||||
/* Now the alias list */
|
/* Now the alias list */
|
||||||
|
|
||||||
alias_list = TreeStore::create (alias_columns);
|
alias_list = TreeStore::create (alias_columns);
|
||||||
|
|
@ -113,17 +110,16 @@ ThemeManager::ThemeManager()
|
||||||
theme_selection_hbox.pack_start (dark_button);
|
theme_selection_hbox.pack_start (dark_button);
|
||||||
theme_selection_hbox.pack_start (light_button);
|
theme_selection_hbox.pack_start (light_button);
|
||||||
|
|
||||||
Gtk::VBox* vbox = Gtk::manage (new Gtk::VBox ());
|
set_homogeneous (false);
|
||||||
vbox->set_homogeneous (false);
|
pack_start (theme_selection_hbox, PACK_SHRINK);
|
||||||
vbox->pack_start (theme_selection_hbox, PACK_SHRINK);
|
pack_start (reset_button, PACK_SHRINK);
|
||||||
vbox->pack_start (reset_button, PACK_SHRINK);
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
vbox->pack_start (all_dialogs, PACK_SHRINK);
|
pack_start (all_dialogs, PACK_SHRINK);
|
||||||
#endif
|
#endif
|
||||||
vbox->pack_start (flat_buttons, PACK_SHRINK);
|
pack_start (flat_buttons, PACK_SHRINK);
|
||||||
vbox->pack_start (blink_rec_button, PACK_SHRINK);
|
pack_start (blink_rec_button, PACK_SHRINK);
|
||||||
vbox->pack_start (region_color_button, PACK_SHRINK);
|
pack_start (region_color_button, PACK_SHRINK);
|
||||||
vbox->pack_start (show_clipping_button, PACK_SHRINK);
|
pack_start (show_clipping_button, PACK_SHRINK);
|
||||||
|
|
||||||
Gtk::HBox* hbox;
|
Gtk::HBox* hbox;
|
||||||
|
|
||||||
|
|
@ -137,7 +133,7 @@ ThemeManager::ThemeManager()
|
||||||
hbox->set_spacing (6);
|
hbox->set_spacing (6);
|
||||||
hbox->pack_start (icon_set_label, false, false);
|
hbox->pack_start (icon_set_label, false, false);
|
||||||
hbox->pack_start (icon_set_dropdown, true, true);
|
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->set_spacing (6);
|
||||||
hbox->pack_start (waveform_gradient_depth, true, true);
|
hbox->pack_start (waveform_gradient_depth, true, true);
|
||||||
hbox->pack_start (waveform_gradient_depth_label, false, false);
|
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 = Gtk::manage (new Gtk::HBox());
|
||||||
hbox->set_spacing (6);
|
hbox->set_spacing (6);
|
||||||
hbox->pack_start (timeline_item_gradient_depth, true, true);
|
hbox->pack_start (timeline_item_gradient_depth, true, true);
|
||||||
hbox->pack_start (timeline_item_gradient_depth_label, false, false);
|
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_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(),
|
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 (palette_scroller, _("Palette"));
|
||||||
notebook.append_page (modifier_scroller, _("Modifiers"));
|
notebook.append_page (modifier_scroller, _("Modifiers"));
|
||||||
|
|
||||||
vbox->pack_start (notebook);
|
pack_start (notebook);
|
||||||
|
|
||||||
vbox->show_all ();
|
show_all ();
|
||||||
|
|
||||||
add (*vbox);
|
|
||||||
|
|
||||||
waveform_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED);
|
waveform_gradient_depth.set_update_policy (Gtk::UPDATE_DELAYED);
|
||||||
timeline_item_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_aliases ();
|
||||||
setup_modifiers ();
|
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));
|
ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ThemeManager::colors_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,6 @@
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
#include "canvas/canvas.h"
|
#include "canvas/canvas.h"
|
||||||
|
|
||||||
#include "ardour_window.h"
|
|
||||||
|
|
||||||
#include "ui_config.h"
|
#include "ui_config.h"
|
||||||
|
|
||||||
namespace ArdourCanvas {
|
namespace ArdourCanvas {
|
||||||
|
|
@ -43,7 +41,7 @@ namespace ArdourCanvas {
|
||||||
|
|
||||||
class ArdourDialog;
|
class ArdourDialog;
|
||||||
|
|
||||||
class ThemeManager : public ArdourWindow
|
class ThemeManager : public Gtk::VBox
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThemeManager();
|
ThemeManager();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue