diff options
author | Carl Hetherington <carl@carlh.net> | 2011-01-06 00:29:40 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-01-06 00:29:40 +0000 |
commit | 1f8e12a1b1cd5d6e4d2ec4961f6c50c671bf75b1 (patch) | |
tree | b9bbb905ff2e6be38dd21ef7b372d18d6de65af6 /gtk2_ardour/processor_box.cc | |
parent | cf1541c3086b376ecac1b70cafef058b4348ab96 (diff) |
Another try at prettifying the processor list with different colours pre- and post-fader, a border etc. All colours should now be configurable from the UI RC file.
git-svn-id: svn://localhost/ardour2/branches/3.0@8453 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/processor_box.cc')
-rw-r--r-- | gtk2_ardour/processor_box.cc | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 93a1d14bed..45cf5d7660 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -101,14 +101,17 @@ ProcessorEntry::ProcessorEntry (boost::shared_ptr<Processor> p, Width w) _event_box.add (_name); _hbox.pack_start (_event_box, true, true); _vbox.pack_start (_hbox); + _frame.add (_vbox); + + _frame.set_name ("ProcessorFrame"); _name.set_alignment (0, 0.5); _name.set_text (name ()); _name.set_padding (2, 2); if (boost::dynamic_pointer_cast<Amp> (p)) { - /* Highlight the fader processor so that pre- and post-fader processors are more obvious */ - _event_box.modify_bg (STATE_NORMAL, Gdk::Color ("#4f4f4f")); + /* Fader processor gets a special look */ + _event_box.set_name ("ProcessorFader"); _name.set_padding (2, 4); } @@ -128,7 +131,7 @@ ProcessorEntry::action_widget () Gtk::Widget& ProcessorEntry::widget () { - return _vbox; + return _frame; } string @@ -295,9 +298,10 @@ ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelecto pack_start (processor_scroller, true, true); processor_display.set_flags (CAN_FOCUS); - processor_display.set_name ("ProcessorSelector"); + processor_display.set_name ("ProcessorList"); processor_display.set_size_request (48, -1); processor_display.set_data ("processorbox", this); + processor_display.set_spacing (2); processor_display.signal_enter_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::enter_notify), false); processor_display.signal_leave_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::leave_notify), false); @@ -989,6 +993,8 @@ ProcessorBox::redisplay_processors () i = j; } + + setup_entry_widget_names (); } /** Add a ProcessorWindowProxy for a processor to our list, if that processor does @@ -1079,6 +1085,26 @@ void ProcessorBox::reordered () { compute_processor_sort_keys (); + setup_entry_widget_names (); +} + +/* Name the Entry widgets according to pre- or post-fader so that they get coloured right */ +void +ProcessorBox::setup_entry_widget_names () +{ + list<ProcessorEntry*> children = processor_display.children (); + bool pre_fader = true; + for (list<ProcessorEntry*>::iterator i = children.begin(); i != children.end(); ++i) { + if (boost::dynamic_pointer_cast<Amp>((*i)->processor())) { + pre_fader = false; + } else { + if (pre_fader) { + (*i)->action_widget().set_name ("ProcessorPreFader"); + } else { + (*i)->action_widget().set_name ("ProcessorPostFader"); + } + } + } } void |