diff options
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r-- | gtk2_ardour/option_editor.cc | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index dcae19ef77..f118566405 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -40,17 +40,47 @@ void OptionEditorComponent::add_widget_to_page (OptionEditorPage* p, Gtk::Widget* w) { int const n = p->table.property_n_rows(); - p->table.resize (n + 1, 3); + int m = n + 1; + if (!_note.empty ()) { + ++m; + } + + p->table.resize (m, 3); p->table.attach (*w, 1, 3, n, n + 1, FILL | EXPAND); + + maybe_add_note (p, n + 1); } void OptionEditorComponent::add_widgets_to_page (OptionEditorPage* p, Gtk::Widget* wa, Gtk::Widget* wb) { int const n = p->table.property_n_rows(); - p->table.resize (n + 1, 3); + int m = n + 1; + if (!_note.empty ()) { + ++m; + } + + p->table.resize (m, 3); p->table.attach (*wa, 1, 2, n, n + 1, FILL); p->table.attach (*wb, 2, 3, n, n + 1, FILL | EXPAND); + + maybe_add_note (p, n + 1); +} + +void +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))); + l->set_use_markup (true); + p->table.attach (*l, 1, 3, n, n + 1, FILL | EXPAND); + } +} + +void +OptionEditorComponent::set_note (string const & n) +{ + _note = n; } OptionEditorHeading::OptionEditorHeading (string const & h) |