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 | |
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
-rw-r--r-- | gtk2_ardour/ardour3_ui_dark.rc.in | 54 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.cc | 34 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.h | 5 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/dndvbox.h | 31 |
4 files changed, 92 insertions, 32 deletions
diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index a50968b91a..ae8e6cf2bf 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -1205,36 +1205,48 @@ style "inspector_track_list_display" = "track_list_display" base[SELECTED] = { 0.3, 0.3, 0.4 } } -style "processor_list_display" +style "processor_list" { - # font_name = "@FONT_SMALL@" - # text[NORMAL] = { 0.80, 0.80, 0.80 } - # text[ACTIVE] = { 0.70, 0.70, 0.70 } - # text[INSENSITIVE] = { 0, 0, 0 } - # text[SELECTED] = { 0.9, 0.3, 0.3 } - - # base[NORMAL] = { 0, 0, 0 } - # base[ACTIVE] = { 0, 0, 0 } - # base[INSENSITIVE] = { 0, 0, 0 } - # base[SELECTED] = { 0, 0, 0 } - - # # these two are explicitly used by the cell renderer for the - # # text - - # fg[NORMAL] = { 0.5, 0.5, 0.5 } # used for inactive - # fg[ACTIVE] = { 1.0, 1.0, 1.0 } # used for active - font_name = "@FONT_SMALLER@" + + # Basic background colour bg[NORMAL] = { 0, 0, 0 } + # A selected processor bg[SELECTED] = { 0, 0.5, 0.9 } + # A send processor whose level is being controlled by the fader bg[ACTIVE] = { 0.19, 0.97, 0.69 } fg[ACTIVE] = { 0.0, 0.0, 0.0 } + GtkCheckButton::indicator-size = 10 GtkCheckButton::indicator-spacing = 0 } +style "processor_frame" +{ + # Colour of the frame of a processor in the processor list + bg[NORMAL] = { 0.6, 0.6, 0.6 } +} + +# A pre-fader processor +style "processor_prefader" +{ + bg[NORMAL] = { 0.2, 0.0, 0.0 } +} + +# The fader processor +style "processor_fader" +{ + bg[NORMAL] = { 0.4, 0.4, 0.4 } +} + +# A post-fader processor +style "processor_postfader" +{ + bg[NORMAL] = { 0.0, 0.2, 0.0 } +} + # MixerPanZone: # # the NORMAL fg color is used for the pan puck @@ -1868,7 +1880,11 @@ widget "*EditorHScrollbar" style:highest "editor_hscrollbar" widget "*OddPortGroups" style:highest "odd_port_groups" widget "*EvenPortGroups" style:highest "even_port_groups" widget "*MidiListView*" style:highest "white_tree_view" -widget "*ProcessorSelector*" style:highest "processor_list_display" +widget "*ProcessorList*" style:highest "processor_list" +widget "*ProcessorFrame*" style:highest "processor_frame" +widget "*ProcessorPreFader" style:highest "processor_prefader" +widget "*ProcessorFader" style:highest "processor_fader" +widget "*ProcessorPostFader" style:highest "processor_postfader" widget "*PortMatrixLabel*" style:highest "small_text" widget "*MidiTracerTextView" style:highest "midi_tracer_textview" widget "*SoloIsolatedLED" style:highest "solo_isolate_led" 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 diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 6a9c1312ad..03ed8eb148 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -120,7 +120,8 @@ private: void processor_active_changed (); void processor_property_changed (const PBD::PropertyChange&); std::string name () const; - + + Gtk::Frame _frame; Gtk::EventBox _event_box; Gtk::Label _name; Gtk::HBox _hbox; @@ -292,6 +293,8 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void weird_plugin_dialog (ARDOUR::Plugin& p, ARDOUR::Route::ProcessorStreams streams); void on_size_allocate (Gtk::Allocation &); + void setup_entry_widget_names (); + static ProcessorBox* _current_processor_box; static void rb_choose_aux (boost::weak_ptr<ARDOUR::Route>); diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index 9afec560fc..582696ffe5 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -162,9 +162,9 @@ public: /** Look at a y coordinate and find the children below y, and the ones either side. * @param y y position. * @param before Filled in with the child before, or 0. - * @param before Filled in with the child under y, or 0. + * @param at Filled in with the child under y, or 0. * @param after Filled in with the child after, or 0. - * @return Fractional position in terms of child height. + * @return Fractional position in terms of child height, or -1 if not over a child. */ double get_children_around_position (int y, T** before, T** at, T** after) const { @@ -173,17 +173,28 @@ public: return -1; } - /* fractional position in terms of children */ - double const nf = double (y) / _children.front()->widget().get_allocation().get_height (); - *before = 0; - int i = 0; typename std::list<T*>::const_iterator j = _children.begin (); - while (i < int (nf) && j != _children.end()) { + + /* index of current child */ + int i = 0; + /* top of current child */ + double top = 0; + /* bottom of current child */ + double bottom = (*j)->widget().get_allocation().get_height (); + + while (y >= bottom && j != _children.end()) { + + top = bottom; + *before = *j; ++i; ++j; + + if (j != _children.end()) { + bottom += (*j)->widget().get_allocation().get_height (); + } } if (j == _children.end()) { @@ -197,7 +208,7 @@ public: ++j; *after = j != _children.end() ? *j : 0; - return nf; + return i + ((y - top) / (*at)->widget().get_allocation().get_height()); } /** @param y y coordinate. @@ -214,6 +225,10 @@ public: return r; } + + void set_spacing (int s) { + _internal_vbox.set_spacing (s); + } /** Children have been reordered by a drag */ sigc::signal<void> Reordered; |