diff --git a/common/dialogs/dialog_color_picker.cpp b/common/dialogs/dialog_color_picker.cpp index 1d7e5c73f9..4cad19925c 100644 --- a/common/dialogs/dialog_color_picker.cpp +++ b/common/dialogs/dialog_color_picker.cpp @@ -184,6 +184,9 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo swatch->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( DIALOG_COLOR_PICKER::buttColorClick ), NULL, this ); + swatch->Connect( wxEVT_LEFT_DCLICK, + wxMouseEventHandler( DIALOG_COLOR_PICKER::colorDClick ), + NULL, this ); }; // If no predefined list is given, build the default predefined colors: @@ -523,6 +526,13 @@ void DIALOG_COLOR_PICKER::drawAll() } +void DIALOG_COLOR_PICKER::colorDClick( wxMouseEvent& event ) +{ + buttColorClick( event ); + wxDialog::EndModal( wxID_OK ); +} + + void DIALOG_COLOR_PICKER::buttColorClick( wxMouseEvent& event ) { int id = event.GetId(); diff --git a/include/dialogs/dialog_color_picker.h b/include/dialogs/dialog_color_picker.h index 31501cfd57..4a8819a132 100644 --- a/include/dialogs/dialog_color_picker.h +++ b/include/dialogs/dialog_color_picker.h @@ -177,6 +177,9 @@ private: ///< Event handler for defined color buttons void buttColorClick( wxMouseEvent& event ); + ///< Event handler for double click on color buttons + void colorDClick( wxMouseEvent& event ); + ///< called when creating the dialog bool TransferDataToWindow() override;