From 83e452390d9a30bf9966a41324694f129bcd716f Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 30 Sep 2020 17:46:47 -0400 Subject: [PATCH] Improve color picker dialog when starting from UNSPECIFIED --- common/dialogs/dialog_color_picker.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/dialogs/dialog_color_picker.cpp b/common/dialogs/dialog_color_picker.cpp index 1fdfec193d..a52d41060d 100644 --- a/common/dialogs/dialog_color_picker.cpp +++ b/common/dialogs/dialog_color_picker.cpp @@ -60,10 +60,19 @@ DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER( wxWindow* aParent, const COLOR4D& aCur if( !m_allowOpacityCtrl ) { m_SizerTransparency->Show( false ); - m_previousColor4D.a = 1.0; - m_newColor4D.a = 1.0; + + if( aCurrentColor != COLOR4D::UNSPECIFIED ) + { + m_previousColor4D.a = 1.0; + m_newColor4D.a = 1.0; + } } + // UNSPECIFIED is ( 0, 0, 0, 0 ) but that is unfriendly for editing because you have to notice + // first that the value slider is all the way down before you get any color + if( aCurrentColor == COLOR4D::UNSPECIFIED ) + m_val = 1.0; + APP_SETTINGS_BASE* cfg = Kiface().KifaceSettings(); wxASSERT( cfg );