From kde-commits Sun Jan 31 14:24:20 2016 From: Sven Langkamp Date: Sun, 31 Jan 2016 14:24:20 +0000 To: kde-commits Subject: [krita] libs/ui: Draw empty circles for empty slots in the popup palette Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145425027024757 Git commit 458c15b47f49f0dde7eabd053c3882fd37db99b5 by Sven Langkamp. Committed on 31/01/2016 at 14:23. Pushed by langkamp into branch 'master'. Draw empty circles for empty slots in the popup palette M +11 -4 libs/ui/kis_popup_palette.cpp http://commits.kde.org/krita/458c15b47f49f0dde7eabd053c3882fd37db99b5 diff --git a/libs/ui/kis_popup_palette.cpp b/libs/ui/kis_popup_palette.cpp index 1d27b58e0..63c2c6f 100644 --- a/libs/ui/kis_popup_palette.cpp +++ b/libs/ui/kis_popup_palette.cpp @@ -290,14 +290,21 @@ void KisPopupPalette::paintEvent(QPaintEvent* e) = //painting favorite brushes pixmap/icon QPainterPath path; - for (int pos =3D 0; pos < images.size(); pos++) { + for (int pos =3D 0; pos < numSlots(); pos++) { painter.save(); = path =3D pathFromPresetIndex(pos); - painter.setClipPath(path); + = + if(pos < images.size()) + { + painter.setClipPath(path); = - QRect bounds =3D path.boundingRect().toAlignedRect(); - painter.drawImage(bounds.topLeft() , images.at(pos).scaled(bounds.= size() , Qt::KeepAspectRatioByExpanding)); + QRect bounds =3D path.boundingRect().toAlignedRect(); + painter.drawImage(bounds.topLeft() , images.at(pos).scaled(bou= nds.size() , Qt::KeepAspectRatioByExpanding)); + } + else { + painter.fillPath(path, palette().brush(QPalette::Window)); = + } painter.drawPath(path); = painter.restore();