OptionEditorComponent::maybe_add_note (OptionEditorPage* p, int n)
{
if (!_note.empty ()) {
- Gtk::Label* l = manage (new Gtk::Label (string_compose (X_("<i>%1</i>"), _note)));
+ Gtk::Label* l = manage (left_aligned_label (string_compose (X_("<i>%1</i>"), _note)));
l->set_use_markup (true);
l->set_line_wrap (true);
p->table.attach (*l, 1, 3, n, n + 1, FILL | EXPAND);
}
}
+/*--------------------------*/
+
+CheckOption::CheckOption (string const & i, string const & n, Glib::RefPtr<Gtk::Action> act)
+{
+ _button = manage (new CheckButton);
+ _label = manage (new Label);
+ _label->set_markup (n);
+ _button->add (*_label);
+ _button->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::toggled));
+
+ Gtkmm2ext::Activatable::set_related_action (act);
+ assert (_action);
+
+ action_sensitivity_changed ();
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ action_toggled ();
+ tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
+ }
+
+ _action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &CheckOption::action_sensitivity_changed));
+}
+
+void
+CheckOption::action_toggled ()
+{
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ _button->set_active (tact->get_active());
+ }
+}
+
+void
+CheckOption::add_to_page (OptionEditorPage* p)
+{
+ add_widget_to_page (p, _button);
+}
+
+void
+CheckOption::toggled ()
+{
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+
+ tact->set_active (_button->get_active ());
+}
+
+
/*--------------------------*/
BoolOption::BoolOption (string const & i, string const & n, sigc::slot<bool> g, sigc::slot<bool, bool> s)
, _get (g)
, _set (s)
{
- _db_slider = manage (new HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
+ _db_slider = manage (new ArdourWidgets::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
_label.set_text (n + ":");
_label.set_alignment (0, 0.5);
ClockOption::set_state_from_config ()
{
Timecode::Time TC;
- framepos_t when;
+ samplepos_t when;
if (!Timecode::parse_timecode_format(_get(), TC)) {
_clock.set (0, true);
}
/*--------------------------*/
+WidgetOption::WidgetOption (string const & i, string const & n, Gtk::Widget& w)
+ : Option (i, n)
+ , _widget (&w)
+{
+}
+
+void
+WidgetOption::add_to_page (OptionEditorPage* p)
+{
+ add_widget_to_page (p, _widget);
+}
+
+/*--------------------------*/
+
OptionEditorPage::OptionEditorPage ()
: table (1, 3)
{
: OptionEditor (c)
{
set_border_width (4);
- hpacker.pack_start (treeview(), false, false);
+ Frame* f = manage (new Frame ());
+ f->add (treeview());
+ f->set_shadow_type (Gtk::SHADOW_OUT);
+ f->set_border_width (0);
+ hpacker.pack_start (*f, false, false, 4);
hpacker.pack_start (notebook(), false, false);
pack_start (hpacker, true, true);
, ArdourWindow (str)
{
container.set_border_width (4);
- hpacker.pack_start (treeview(), false, false);
- hpacker.pack_start (notebook(), true, true);
+ Frame* f = manage (new Frame ());
+ f->add (treeview());
+ f->set_shadow_type (Gtk::SHADOW_OUT);
+ f->set_border_width (0);
+ hpacker.pack_start (*f, false, false);
+ hpacker.pack_start (notebook(), true, true, 4);
container.pack_start (hpacker, true, true);