Skip to content

Commit

Permalink
Fix color picker does not show previous color
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 28, 2016
1 parent f63a69b commit e1e3f86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/qgscolorbutton.cpp
Expand Up @@ -97,9 +97,16 @@ void QgsColorButton::showColorDialog()
QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this );
if ( panel && panel->dockMode() )
{
QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, color(), QgsCompoundColorWidget::LayoutVertical );
QColor currentColor = color();
QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, currentColor, QgsCompoundColorWidget::LayoutVertical );
colorWidget->setPanelTitle( mColorDialogTitle );
colorWidget->setAllowAlpha( mAllowAlpha );

if ( currentColor.isValid() )
{
colorWidget->setPreviousColor( currentColor );
}

connect( colorWidget, SIGNAL( currentColorChanged( QColor ) ), this, SLOT( setValidTemporaryColor( QColor ) ) );
panel->openPanel( colorWidget );
return;
Expand Down

0 comments on commit e1e3f86

Please sign in to comment.