summaryrefslogtreecommitdiff
path: root/gtk2_ardour/stripable_colorpicker.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-03-31 02:21:38 +0200
committerRobin Gareus <robin@gareus.org>2017-03-31 02:21:38 +0200
commit9436d0cb867e4a923cb5a8bc459fe62cb4d3a70e (patch)
tree76a09403920f8e1e0bd9ff82a779759a43af398e /gtk2_ardour/stripable_colorpicker.cc
parenteea8fbd1c5ea5ab540e2deb8e212d29e19cb20c0 (diff)
Hide eyedropper color-picker on mac
It not only does not work, but also locks up the Desktop/Window manager in odd ways.
Diffstat (limited to 'gtk2_ardour/stripable_colorpicker.cc')
-rw-r--r--gtk2_ardour/stripable_colorpicker.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk2_ardour/stripable_colorpicker.cc b/gtk2_ardour/stripable_colorpicker.cc
index 3defed8120..4e8fe339d4 100644
--- a/gtk2_ardour/stripable_colorpicker.cc
+++ b/gtk2_ardour/stripable_colorpicker.cc
@@ -33,6 +33,31 @@ StripableColorDialog::StripableColorDialog ()
{
initialize_color_palette ();
signal_response().connect (sigc::mem_fun (*this, &StripableColorDialog::finish_color_edit));
+
+#ifdef __APPLE__
+ /* hide eyedropper button -- which does not work on OSX:
+ * " the problem is worse than just `not getting the color' though.
+ * The action doesn't actually complete, and window focus is in a
+ * `weird state' until you click inside the color-picker dialog twice;
+ * then it all seems back to normal (but no color got picked)"
+ *
+ * the alternative is to patch gtk's source:
+ * gtk/gtkcolorsel.c gtk_color_selection_init() which packs
+ *
+ * top_hbox [ VBOX [ triangle || hbox [ sample-area || picker-button] ] || ... ]
+ */
+ ColorSelection* cs = get_colorsel(); // IS-A VBOX
+ if (!cs) { return ; }
+ Gtk::HBox* top_hbox = dynamic_cast<Gtk::HBox*> (cs->children()[0].get_widget());
+ if (!top_hbox) { return ; }
+ Gtk::VBox* vbox = dynamic_cast<Gtk::VBox*> (top_hbox->children()[0].get_widget());
+ if (!vbox) { return ; }
+ Gtk::HBox* hbox = dynamic_cast<Gtk::HBox*> (vbox->children()[1].get_widget());
+ if (!hbox) { return ; }
+ Gtk::Button* picker = dynamic_cast<Gtk::Button*> (hbox->children()[1].get_widget());
+ if (!picker) { return ; }
+ picker->hide ();
+#endif
}
StripableColorDialog::~StripableColorDialog ()