Page MenuHomePhabricator

color.patch

Authored By
goch
Jul 7 2010, 2:32 PM
Size
858 B
Referenced Files
None
Subscribers
None

color.patch

Index: QmitkPropertyDelegate.cpp
===================================================================
--- QmitkPropertyDelegate.cpp (revision 24406)
+++ QmitkPropertyDelegate.cpp (working copy)
@@ -96,6 +96,15 @@
colorBtn->setStyleSheet(QString("background-color: %1;foreground-color: %1; border-style: none;").arg(result.name()));
//colorBtn->setFlat(true);
}
+ // QColorDialog closed by 'Cancel' button, use the old property color
+ else
+ {
+ QPalette palette = colorBtn->palette();
+ palette.setColor(QPalette::Button, color);
+ colorBtn->setPalette(palette);
+ colorBtn->setStyleSheet(QString("background-color: %1;foreground-color: %1; border-style: none;").arg(color.name()));
+
+ }
connect(colorBtn, SIGNAL(pressed()), this, SLOT(commitAndCloseEditor()));

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
530
Default Alt Text
color.patch (858 B)

Event Timeline

Do not change color if canceled