Commit 3f30e39f authored by Halla Rempt's avatar Halla Rempt

Fix painting in workspace chooser

parent 4a10bc1c
......@@ -55,18 +55,20 @@ public:
void KisWorkspaceDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
{
if (! index.isValid())
if (!index.isValid())
return;
KisWorkspaceResource* workspace = static_cast<KisWorkspaceResource*>(index.internalPointer());
QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? QPalette::Active : QPalette::Disabled;
QPalette::ColorRole cr = (option.state & QStyle::State_Selected) ? QPalette::HighlightedText : QPalette::Text;
painter->setPen(option.palette.color(cg, cr));
if (option.state & QStyle::State_Selected) {
painter->setPen(QPen(option.palette.highlight(), 2.0));
painter->fillRect(option.rect, option.palette.highlight());
painter->setBrush(option.palette.highlightedText());
}
else {
painter->setBrush(option.palette.text());
painter->fillRect(option.rect, option.palette.base());
}
......@@ -155,7 +157,6 @@ void KisWorkspaceChooser::resourceSelected(KoResource* resource)
m_view->resourceProvider()->notifyLoadingWorkspace(workspace);
foreach(QDockWidget *docker, dockWidgetMap.keys()) {
qDebug() << docker << docker->isVisible() << docker->property("Locked");
if (docker->isVisible()) {
docker->setProperty("Locked", dockWidgetMap[docker]);
docker->updateGeometry();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment