Improve color picker dialog when starting from UNSPECIFIED

This commit is contained in:
Jon Evans 2020-09-30 17:46:47 -04:00
parent 7c003f98d5
commit 83e452390d
1 changed files with 11 additions and 2 deletions

View File

@ -60,10 +60,19 @@ DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER( wxWindow* aParent, const COLOR4D& aCur
if( !m_allowOpacityCtrl ) if( !m_allowOpacityCtrl )
{ {
m_SizerTransparency->Show( false ); 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(); APP_SETTINGS_BASE* cfg = Kiface().KifaceSettings();
wxASSERT( cfg ); wxASSERT( cfg );