diff --git a/include/wx/clrpicker.h b/include/wx/clrpicker.h index 5e30999e06..840e0b1123 100644 --- a/include/wx/clrpicker.h +++ b/include/wx/clrpicker.h @@ -68,6 +68,7 @@ protected: // NOTE: this style is supported just by wxColourButtonGeneric and // thus is not exposed in wxColourPickerCtrl #define wxCLRP_SHOW_LABEL 0x0008 +#define wxCLRP_SHOW_ALPHA 0x0010 // map platform-dependent controls which implement the wxColourPickerWidgetBase // under the name "wxColourPickerWidget". @@ -146,7 +147,7 @@ public: // internal functions protected: virtual long GetPickerStyle(long style) const wxOVERRIDE - { return (style & wxCLRP_SHOW_LABEL); } + { return (style & (wxCLRP_SHOW_LABEL | wxCLRP_SHOW_ALPHA)); } private: wxDECLARE_DYNAMIC_CLASS(wxColourPickerCtrl); diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index a51491d552..14cff5db3e 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -78,6 +78,9 @@ bool wxColourButton::Create( wxWindow *parent, wxWindowID id, #endif g_object_ref(m_widget); + // Display opacity slider + g_object_set(G_OBJECT(m_widget), "use-alpha", + static_cast(style & wxCLRP_SHOW_ALPHA), NULL); // GtkColourButton signals g_signal_connect(m_widget, "color-set", G_CALLBACK(gtk_clrbutton_setcolor_callback), this);