2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "fix_carbon.h"
25 #include "pbd/gstdio_compat.h"
27 #include <gtkmm/settings.h>
29 #include "gtkmm2ext/gtk_ui.h"
30 #include "gtkmm2ext/utils.h"
32 #include "pbd/compose.h"
34 #include "ardour/profile.h"
36 #include "canvas/wave_view.h"
38 #include "ardour_button.h"
39 #include "ardour_dialog.h"
40 #include "theme_manager.h"
41 #include "ui_config.h"
49 using namespace ARDOUR;
50 using namespace ARDOUR_UI_UTILS;
52 ThemeManager::ThemeManager()
58 "all-floating-windows-are-dialogs",
59 _("All floating windows are dialogs"),
60 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_all_floating_windows_are_dialogs),
61 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_all_floating_windows_are_dialogs)
63 bo->add_to_page (this);
64 bo->set_state_from_config ();
65 Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget (), string_compose (
66 _("Mark all floating windows to be type \"Dialog\" rather than using \"Utility\" for some.\n"
67 "This may help with some window managers. This requires a restart of %1 to take effect"),
71 "transients-follow-front",
72 _("Transient windows follow front window."),
73 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_transients_follow_front),
74 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_transients_follow_front)
76 bo->add_to_page (this);
77 bo->set_state_from_config ();
78 Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget (), string_compose (
79 _("Make transient windows follow the front window when toggling between the editor and mixer.\n"
80 "This requires a restart of %1 to take effect"), PROGRAM_NAME));
83 if (!Profile->get_mixbus()) {
85 "floating-monitor-section",
86 _("Float detached monitor-section window"),
87 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_floating_monitor_section),
88 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_floating_monitor_section)
90 bo->add_to_page (this);
91 bo->set_state_from_config ();
92 Gtkmm2ext::UI::instance()->set_tip (bo->tip_widget (), string_compose (
93 _("When detaching the monitoring section, mark it as \"Utility\" window to stay in front.\n"
94 "This requires a restart of %1 to take effect"), PROGRAM_NAME));
99 _("Draw \"flat\" buttons"),
100 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_flat_buttons),
101 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_flat_buttons)
103 bo->add_to_page (this);
104 bo->set_state_from_config ();
106 vector<string> icon_sets = ::get_icon_sets ();
107 if (icon_sets.size() > 1) {
108 ComboOption<std::string>* io = new ComboOption<std::string> (
109 "icon-set", _("Icon Set"),
110 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_icon_set),
111 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_icon_set)
113 for (vector<string>::const_iterator i = icon_sets.begin (); i != icon_sets.end (); ++i) {
116 io->add_to_page (this);
117 io->set_state_from_config ();
120 HSliderOption *hs = new HSliderOption(
121 "timeline-item-gradient-depth",
122 _("Waveforms color gradient depth"),
123 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_waveform_gradient_depth),
124 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_waveform_gradient_depth),
127 hs->scale().set_update_policy (Gtk::UPDATE_DELAYED);
128 hs->add_to_page (this);
129 hs->set_state_from_config ();
131 hs = new HSliderOption(
132 "timeline-item-gradient-depth",
133 _("Timeline item gradient depth"),
134 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_timeline_item_gradient_depth),
135 sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_timeline_item_gradient_depth),
138 hs->scale().set_update_policy (Gtk::UPDATE_DELAYED);
139 hs->add_to_page (this);
140 hs->set_state_from_config ();
144 ThemeManager::set_state_from_config ()