Comment button hilighted when comments exist. Thanks Brian!
authorTaybin Rutkin <taybin@taybin.com>
Mon, 6 Nov 2006 17:22:13 +0000 (17:22 +0000)
committerTaybin Rutkin <taybin@taybin.com>
Mon, 6 Nov 2006 17:22:13 +0000 (17:22 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1076 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/mixer_strip.cc
gtk2_ardour/mixer_strip.h

index 236e89f9927f7a3aee12115d72f9fda3e489da38..c84bdad4e5d51f0f9f3174b8a07ca22d26086e37 100644 (file)
@@ -232,6 +232,8 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
                                                        _route->comment());
 
        comment_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::comment_button_clicked));
+       comment_button.signal_enter().connect (mem_fun(*this, &MixerStrip::comment_button_refresh));
+       comment_button.signal_leave().connect (mem_fun(*this, &MixerStrip::comment_button_refresh));
        
        global_vpacker.set_border_width (0);
        global_vpacker.set_spacing (0);
@@ -759,6 +761,13 @@ MixerStrip::output_changed (IOChange change, void *src)
        Gtkmm2ext::UI::instance()->call_slot (mem_fun(*this, &MixerStrip::update_output_display));
 }
 
+void
+MixerStrip::comment_button_refresh() {
+       if (! _route->comment().empty()) {
+               comment_button.set_state (Gtk::STATE_ACTIVE);
+       }
+}
+
 void 
 MixerStrip::comment_editor_done_editing() {
        string str =  comment_area->get_buffer()->get_text();
@@ -787,6 +796,12 @@ MixerStrip::comment_editor_done_editing() {
                ARDOUR_UI::instance()->tooltips().set_tip (comment_button, 
                                str.empty() ? _("Click to Add/Edit Comments") : str);
        }
+
+       if (! _route->comment().empty()) {
+               comment_button.set_state (Gtk::STATE_ACTIVE);
+       } else {
+               comment_button.set_state (Gtk::STATE_NORMAL);
+       }
 }
 
 void
index 5472778c178f7dff6b6cd0517f23730cd99c5f43..88115c6063d6d78572e1ce02397e830f8026a0f5 100644 (file)
@@ -153,6 +153,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
        Gtk::TextView* comment_area;
        Gtk::Button    comment_button;
 
+       void comment_button_refresh();
        void comment_editor_done_editing();
        void setup_comment_editor ();
        void comment_button_clicked ();