diff options
author | Taybin Rutkin <taybin@taybin.com> | 2006-11-06 17:22:13 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2006-11-06 17:22:13 +0000 |
commit | 0673a5d93ee617185c0eb4b60a062dc9eb19f1a2 (patch) | |
tree | 91cedf097820cb72705f9c99154b9bfda31fa2c1 /gtk2_ardour | |
parent | e91d3fc250e6544024f609c0cb6af80e7bbc844b (diff) |
Comment button hilighted when comments exist. Thanks Brian!
git-svn-id: svn://localhost/ardour2/trunk@1076 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 236e89f992..c84bdad4e5 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -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 diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 5472778c17..88115c6063 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -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 (); |