diff --git a/gtk2_ardour/ardour3_ui_dark.rc.in b/gtk2_ardour/ardour3_ui_dark.rc.in index d0337b57e0..d9e20d1737 100644 --- a/gtk2_ardour/ardour3_ui_dark.rc.in +++ b/gtk2_ardour/ardour3_ui_dark.rc.in @@ -1212,10 +1212,7 @@ style "processor_list" # 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 + # Colours for sends whose level is being controller by the fader bg[ACTIVE] = { 0.19, 0.97, 0.69 } fg[ACTIVE] = { 0.0, 0.0, 0.0 } @@ -1223,37 +1220,49 @@ style "processor_list" GtkCheckButton::indicator-spacing = 0 } -# Colour of the frame of the fader in the processor list -style "processor_fader_frame" +# Colour of a processor frame when it is selected +style "processor_frame_selected" { - bg[NORMAL] = { 0.5, 0.5, 0.5 } + bg[NORMAL] = { 0.9, 0.8, 0.2 } } -# A pre-fader processor's background -style "processor_prefader" +# Colour of a processor frame when it is a send whose level is being controller by the fader +style "processor_frame_active_send" { - bg[NORMAL] = { 0.3, 0.0, 0.0 } + bg[NORMAL] = { 0.19, 0.97, 0.69 } } -# A pre-fader processor's frame -style "processor_prefader_frame" -{ - bg[NORMAL] = { 0.5, 0.0, 0.0 } -} - -# The fader processor +# Fader processor's background style "processor_fader" { bg[NORMAL] = { 0.4, 0.4, 0.4 } } -# A post-fader processor's background +# Fader processor's frame +style "processor_fader_frame" +{ + bg[NORMAL] = { 0.5, 0.5, 0.5 } +} + +# Pre-fader processor's background +style "processor_prefader" +{ + bg[NORMAL] = { 0.3, 0.0, 0.0 } +} + +# Pre-fader processor's frame +style "processor_prefader_frame" +{ + bg[NORMAL] = { 0.5, 0.0, 0.0 } +} + +# Post-fader processor's background style "processor_postfader" { bg[NORMAL] = { 0.1, 0.3, 0.1 } } -# A post-fader processor's frame +# Post-fader processor's frame style "processor_postfader_frame" { bg[NORMAL] = { 0.1, 0.5, 0.1 } @@ -1893,7 +1902,9 @@ widget "*OddPortGroups" style:highest "odd_port_groups" widget "*EvenPortGroups" style:highest "even_port_groups" widget "*MidiListView*" style:highest "white_tree_view" widget "*ProcessorList*" style:highest "processor_list" -widget "*ProcessorFaderFrame*" style:highest "processor_fader_frame" +widget "*ProcessorFrameSelected" style:highest "processor_frame_selected" +widget "*ProcessorFrameActiveSend" style:highest "processor_frame_active_send" +widget "*ProcessorFaderFrame" style:highest "processor_fader_frame" widget "*ProcessorPreFader" style:highest "processor_prefader" widget "*ProcessorPreFaderFrame" style:highest "processor_prefader_frame" widget "*ProcessorFader" style:highest "processor_fader" diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 4ccf52cae1..f64e93b263 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -96,6 +96,8 @@ Glib::RefPtr SendProcessorEntry::_slider; ProcessorEntry::ProcessorEntry (boost::shared_ptr p, Width w) : _processor (p) , _width (w) + , _visual_state (Gtk::STATE_NORMAL) + , _position (PreFader) { _hbox.pack_start (_active, false, false); _event_box.add (_name); @@ -139,6 +141,64 @@ ProcessorEntry::drag_text () const return name (); } +void +ProcessorEntry::set_visual_state (Gtk::StateType t) +{ + _visual_state = t; + setup_visuals (); +} + +void +ProcessorEntry::set_position (Position p) +{ + _position = p; + setup_visuals (); +} + +void +ProcessorEntry::setup_visuals () +{ + switch (_position) { + case PreFader: + _event_box.set_name ("ProcessorPreFader"); + if (_visual_state == Gtk::STATE_NORMAL) { + _frame.set_name ("ProcessorPreFaderFrame"); + } + break; + + case Fader: + _event_box.set_name ("ProcessorFader"); + if (_visual_state == Gtk::STATE_NORMAL) { + _frame.set_name ("ProcessorFaderFrame"); + } + break; + + case PostFader: + _event_box.set_name ("ProcessorPostFader"); + if (_visual_state == Gtk::STATE_NORMAL) { + _frame.set_name ("ProcessorPostFaderFrame"); + } + break; + } + + switch (_visual_state) { + case Gtk::STATE_NORMAL: + /* _frame has been set up above */ + _event_box.set_state (Gtk::STATE_NORMAL); + break; + case Gtk::STATE_SELECTED: + _frame.set_name ("ProcessorFrameSelected"); + /* don't change the background of the box when it is selected */ + _event_box.set_state (Gtk::STATE_NORMAL); + break; + case Gtk::STATE_ACTIVE: + _frame.set_name ("ProcessorFrameActiveSend"); + _event_box.set_state (Gtk::STATE_ACTIVE); + break; + } +} + + boost::shared_ptr ProcessorEntry::processor () const { @@ -994,7 +1054,7 @@ ProcessorBox::redisplay_processors () i = j; } - setup_entry_widget_names (); + setup_entry_positions (); } /** Add a ProcessorWindowProxy for a processor to our list, if that processor does @@ -1085,29 +1145,24 @@ void ProcessorBox::reordered () { compute_processor_sort_keys (); - setup_entry_widget_names (); + setup_entry_positions (); } -/* Name the Entry widgets according to pre- or post-fader so that they get coloured right */ void -ProcessorBox::setup_entry_widget_names () +ProcessorBox::setup_entry_positions () { - /* It just so happens that the action_widget() is the event box (which gives the background - * colour) and the widget() is the frame, more by good luck than good judgement. - */ - list children = processor_display.children (); bool pre_fader = true; + for (list::iterator i = children.begin(); i != children.end(); ++i) { if (boost::dynamic_pointer_cast((*i)->processor())) { pre_fader = false; + (*i)->set_position (ProcessorEntry::Fader); } else { if (pre_fader) { - (*i)->action_widget().set_name ("ProcessorPreFader"); - (*i)->widget().set_name ("ProcessorPreFaderFrame"); + (*i)->set_position (ProcessorEntry::PreFader); } else { - (*i)->action_widget().set_name ("ProcessorPostFader"); - (*i)->widget().set_name ("ProcessorPostFaderFrame"); + (*i)->set_position (ProcessorEntry::PostFader); } } } diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 03ed8eb148..f348569f71 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -106,6 +106,15 @@ public: Gtk::EventBox& action_widget (); Gtk::Widget& widget (); std::string drag_text () const; + void set_visual_state (Gtk::StateType); + + enum Position { + PreFader, + Fader, + PostFader + }; + + void set_position (Position); boost::shared_ptr processor () const; void set_enum_width (Width); virtual void set_pixel_width (int) {} @@ -120,6 +129,7 @@ private: void processor_active_changed (); void processor_property_changed (const PBD::PropertyChange&); std::string name () const; + void setup_visuals (); Gtk::Frame _frame; Gtk::EventBox _event_box; @@ -128,6 +138,8 @@ private: Gtk::CheckButton _active; boost::shared_ptr _processor; Width _width; + Gtk::StateType _visual_state; + Position _position; PBD::ScopedConnection active_connection; PBD::ScopedConnection name_connection; }; @@ -293,7 +305,7 @@ 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 (); + void setup_entry_positions (); static ProcessorBox* _current_processor_box; diff --git a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h index 58d9d3b75a..c2c74e6d55 100644 --- a/libs/gtkmm2ext/gtkmm2ext/dndvbox.h +++ b/libs/gtkmm2ext/gtkmm2ext/dndvbox.h @@ -35,6 +35,9 @@ public: /** @return Text to use in the icon that is dragged */ virtual std::string drag_text () const = 0; + + /** Set the child's visual state */ + virtual void set_visual_state (Gtk::StateType) = 0; }; /** A VBox whose contents can be dragged and dropped */ @@ -495,11 +498,11 @@ private: assert (c); if (c == _active) { - c->action_widget().set_state (Gtk::STATE_ACTIVE); + c->set_visual_state (Gtk::STATE_ACTIVE); } else if (selected (c)) { - c->action_widget().set_state (Gtk::STATE_SELECTED); + c->set_visual_state (Gtk::STATE_SELECTED); } else { - c->action_widget().set_state (Gtk::STATE_NORMAL); + c->set_visual_state (Gtk::STATE_NORMAL); } }