rename join regions op as combine regions; save and restore nested playlists, sources...
[ardour.git] / gtk2_ardour / midi_channel_selector.cc
index 3d44ca2429f738e37c6553041900cae71eb3838b..cdaf42e51f7c327125a787c6b51fee4eeedb7eeb 100644 (file)
@@ -25,7 +25,6 @@
 
 using namespace std;
 using namespace Gtk;
-using namespace sigc;
 using namespace ARDOUR;
 
 MidiChannelSelector::MidiChannelSelector(int n_rows, int n_columns, int start_row, int start_column)
@@ -53,6 +52,10 @@ MidiChannelSelector::MidiChannelSelector(int n_rows, int n_columns, int start_ro
                                        sigc::mem_fun(this, &MidiChannelSelector::button_toggled),
                                        &_buttons[row][column],
                                        channel_nr - 1));
+                       _buttons[row][column].set_widget_name (X_("MidiChannelSelectorButton"));
+
+                       _buttons[row][column].signal_button_release_event().connect(
+                                sigc::mem_fun(this, &MidiChannelSelector::was_clicked), false);
 
                        int table_row    = start_row + row;
                        int table_column = start_column + column;
@@ -65,6 +68,13 @@ MidiChannelSelector::~MidiChannelSelector()
 {
 }
 
+bool
+MidiChannelSelector::was_clicked (GdkEventButton*)
+{
+        clicked ();
+        return false;
+}
+
 void
 MidiChannelSelector::set_channel_colors(const uint32_t new_channel_colors[16])
 {
@@ -85,8 +95,10 @@ MidiChannelSelector::set_default_channel_color()
 {
        for (int row = 0; row < 4; ++row) {
                for (int column = 0; column < 4; ++column) {
-                       _buttons[row][column].unset_bg(STATE_NORMAL);
-                       _buttons[row][column].unset_bg(STATE_ACTIVE);
+                       _buttons[row][column].unset_fg (STATE_NORMAL);
+                       _buttons[row][column].unset_fg (STATE_ACTIVE);
+                       _buttons[row][column].unset_bg (STATE_NORMAL);
+                       _buttons[row][column].unset_bg (STATE_ACTIVE);
                }
        }
 }