[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [krita] libs/ui: Draw empty circles for empty slots in the popup palette
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2016-01-31 14:24:20
Message-ID: E1aPsvM-0006K5-Di () scm ! kde ! org
[Download RAW message or body]

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 = 0; pos < images.size(); pos++) {
+    for (int pos = 0; pos < numSlots(); pos++) {
         painter.save();
 
         path = pathFromPresetIndex(pos);
-        painter.setClipPath(path);
+        
+        if(pos < images.size())
+        {
+            painter.setClipPath(path);
 
-        QRect bounds = path.boundingRect().toAlignedRect();
-        painter.drawImage(bounds.topLeft() , images.at(pos).scaled(bounds.size() , \
Qt::KeepAspectRatioByExpanding)); +            QRect bounds = \
path.boundingRect().toAlignedRect(); +            painter.drawImage(bounds.topLeft() \
, images.at(pos).scaled(bounds.size() , Qt::KeepAspectRatioByExpanding)); +        }
+        else {
+            painter.fillPath(path, palette().brush(QPalette::Window));     
+        }
         painter.drawPath(path);
         
         painter.restore();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic