Skip to content
Permalink
Browse files

Fix color picker does not show previous color

  • Loading branch information
nyalldawson committed Oct 28, 2016
1 parent f63a69b commit e1e3f86b9e8cc1e42756732769ef1f9b8f897b27
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/gui/qgscolorbutton.cpp
@@ -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;

0 comments on commit e1e3f86

Please sign in to comment.
You can’t perform that action at this time.