summaryrefslogtreecommitdiff
path: root/gtk2_ardour/option_editor.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-12-08 21:52:50 +0100
committerRobin Gareus <robin@gareus.org>2015-12-08 21:52:50 +0100
commit9b0619bd802ca42d3009f6c93298a7f218497f97 (patch)
tree1fa273e5341adad3301b42894a35ff2d0b0b26a8 /gtk2_ardour/option_editor.cc
parent2f5c4c29c6d60b172676a0f79c542d0ff085a9f6 (diff)
add Action-Button for rc-config dialog
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r--gtk2_ardour/option_editor.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 9ce4997bb8..cd9ff81d1e 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -113,6 +113,31 @@ OptionEditorBox::add_to_page (OptionEditorPage* p)
add_widget_to_page (p, _box);
}
+RcActionButton::RcActionButton (std::string const & t, const Glib::SignalProxy0< void >::SlotType & slot, std::string const & l)
+ : _label (NULL)
+{
+ _button = manage (new Button (t));
+ _button->signal_clicked().connect (slot);
+ if (!l.empty ()) {
+ _label = manage (right_aligned_label (l));
+ }
+}
+
+void
+RcActionButton::add_to_page (OptionEditorPage *p)
+{
+ int const n = p->table.property_n_rows();
+ int m = n + 1;
+ p->table.resize (m, 3);
+ if (_label) {
+ p->table.attach (*_label, 1, 2, n, n + 1, FILL | EXPAND);
+ p->table.attach (*_button, 2, 3, n, n + 1, FILL | EXPAND);
+ } else {
+ p->table.attach (*_button, 1, 3, n, n + 1, FILL | EXPAND);
+ }
+}
+
+
BoolOption::BoolOption (string const & i, string const & n, sigc::slot<bool> g, sigc::slot<bool, bool> s)
: Option (i, n),
_get (g),