From 5ac34ce86b1b51a0a5864d44e5037c7e055c7310 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 23 Aug 2016 20:27:56 +1000 Subject: [PATCH] Restore cancel button in color dialog when used from layer properties --- src/gui/qgscolorbutton.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/qgscolorbutton.cpp b/src/gui/qgscolorbutton.cpp index c0a20b60f5e..c4588f0dad8 100644 --- a/src/gui/qgscolorbutton.cpp +++ b/src/gui/qgscolorbutton.cpp @@ -94,10 +94,10 @@ const QPixmap& QgsColorButton::transparentBackground() void QgsColorButton::showColorDialog() { - if ( QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this ) ) + QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this ); + if ( panel && panel->dockMode() ) { - QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, color(), panel->dockMode() ? QgsCompoundColorWidget::LayoutVertical : - QgsCompoundColorWidget::LayoutDefault ); + QgsCompoundColorWidget* colorWidget = new QgsCompoundColorWidget( panel, color(), QgsCompoundColorWidget::LayoutVertical ); colorWidget->setPanelTitle( mColorDialogTitle ); colorWidget->setAllowAlpha( mAllowAlpha ); connect( colorWidget, SIGNAL( currentColorChanged( QColor ) ), this, SLOT( setValidTemporaryColor( QColor ) ) );