forked from qt-creator/qt-creator
Don't apply base color when color dialog is cancelled
Previously setBaseColor used to refuse setting an invalid color. It doesn't do this anymore, so let's just check for this case here. Change-Id: Ie8a292ca809ac3838c8a52b91a9186dc5dbb992c Reviewed-on: http://codereview.qt.nokia.com/28 Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
This commit is contained in:
committed by
Daniel Molkentin
parent
956bac297b
commit
9c882d8079
@@ -365,8 +365,11 @@ public:
|
||||
|
||||
void mousePressEvent(QMouseEvent *ev)
|
||||
{
|
||||
if (ev->modifiers() & Qt::ShiftModifier)
|
||||
Utils::StyleHelper::setBaseColor(QColorDialog::getColor(Utils::StyleHelper::requestedBaseColor(), m_parent));
|
||||
if (ev->modifiers() & Qt::ShiftModifier) {
|
||||
QColor color = QColorDialog::getColor(Utils::StyleHelper::requestedBaseColor(), m_parent);
|
||||
if (color.isValid())
|
||||
Utils::StyleHelper::setBaseColor(color);
|
||||
}
|
||||
}
|
||||
private:
|
||||
QWidget *m_parent;
|
||||
|
||||
Reference in New Issue
Block a user