Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

BUG:496411 bundle activation status fix

Scott Petrovic0353268e0356
diff --git a/libs/resourcewidgets/KisStorageChooserWidget.cpp b/libs/resourcewidgets/KisStorageChooserWidget.cpp
index 8401c935c3..253b7f252e 100644
--- a/libs/resourcewidgets/KisStorageChooserWidget.cpp
+++ b/libs/resourcewidgets/KisStorageChooserWidget.cpp
@@ -86,6 +86,18 @@ void KisStorageChooserDelegate::paint(QPainter *painter, const QStyleOptionViewI
painter->setPen(penColor);
painter->drawImage(option.rect.topLeft()+QPoint(4, 4), thumbnail, thumbnail.rect());
+
+
+ // Draw is active checkbox
+ QStyleOptionButton checkboxOption;
+ checkboxOption.rect = QRect(option.rect.x() + option.decorationSize.width() + 8,
+ option.rect.y() + option.rect.height() - 30,
+ 20, 20);
+ checkboxOption.state = active ? QStyle::State_On : QStyle::State_Off;
+ QApplication::style()->drawControl(QStyle::CE_CheckBox, &checkboxOption, painter);
+
+
+ // Draw text
QRect text = option.rect;
text.setLeft(text.left()+option.decorationSize.width()+8);
text.setTop(text.top()+4);
@@ -167,6 +179,8 @@ void KisStorageChooserWidget::activated(const QModelIndex &index)
QMessageBox::critical(qApp->activeWindow(), i18nc("@title:window", "Krita"), warning);
}
+ repaint(); // this helps the chooser widget update the active state checkbox. The first checkbox doesn't repaint correctly without it
+
}
KisStorageChooserWidget::~KisStorageChooserWidget()