Skip to content
Permalink
Browse files

Fix color picker does not show previous color

  • Loading branch information
nyalldawson committed Oct 28, 2016
1 parent e812e43 commit df9ce8507e917b320b36f23f1dbb4bb47ffa0ce5
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/gui/qgscolorbuttonv2.cpp
@@ -94,12 +94,19 @@ const QPixmap& QgsColorButtonV2::transparentBackground()

void QgsColorButtonV2::showColorDialog()
{
QColor currentColor = color();
if ( QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this ) )
{
QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, color(), panel->dockMode() ? QgsCompoundColorWidget::LayoutVertical :
QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, currentColor, panel->dockMode() ? QgsCompoundColorWidget::LayoutVertical :
QgsCompoundColorWidget::LayoutDefault );
colorWidget->setPanelTitle( mColorDialogTitle );
colorWidget->setAllowAlpha( mAllowAlpha );

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

connect( colorWidget, SIGNAL( currentColorChanged( QColor ) ), this, SLOT( setValidTemporaryColor( QColor ) ) );
connect( colorWidget, SIGNAL( panelAccepted( QgsPanelWidget* ) ), this, SLOT( panelAccepted( QgsPanelWidget* ) ) );
panel->openPanel( colorWidget );

0 comments on commit df9ce85

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