[Digikam-devel] [Bug 111695] single click to open image editor is really annoying when tagging

Renchi Raju renchi.raju at kdemail.net
Wed Aug 31 06:57:16 BST 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=111695         
renchi.raju kdemail net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From renchi.raju kdemail net  2005-08-31 07:57 -------
SVN commit 455298 by pahlibar:

* apply marcel's patch for executing the items only if
 cursor is in the thumbnail area.
* double the thumbnail spacing making it easier to unselect 
 or do drag selection
* remove the inner white border in the thumbnail highligher.
  makes the highlights look better, imo and also shows more
  of the thumbnail
BUGS: 111695 110178 99416


 M  +15 -0     albumiconitem.cpp  
 M  +2 -0      albumiconitem.h  
 M  +5 -0      iconitem.cpp  
 M  +1 -0      iconitem.h  
 M  +8 -3      iconview.cpp  
 M  +0 -2      thumbnailjob.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumiconitem.cpp #455297:455298
 @ -159,6 +159,18  @
     return 0;
 }
 
+QRect AlbumIconItem::clickToOpenRect()
+{
+    if (tightPixmapRect_.isNull())
+        return rect();
+    
+    QRect pixmapRect = tightPixmapRect_;
+    QRect r          = rect();
+
+    pixmapRect.moveBy(r.x(), r.y());
+    return pixmapRect;
+}
+
 void AlbumIconItem::paintItem()
 {
     QPixmap pix;
 @ -185,6 +197,9  @
         p.drawPixmap(r.x() + (r.width()-thumbnail->width())/2,
                      r.y() + (r.height()-thumbnail->height())/2,
                      *thumbnail);
+        tightPixmapRect_.setRect(r.x() + (r.width()-thumbnail->width())/2,
+                                 r.y() + (r.height()-thumbnail->height())/2,
+                                 thumbnail->width(), thumbnail->height());
         dirty_ = false;
     }
 
--- trunk/extragear/graphics/digikam/digikam/albumiconitem.h #455297:455298
 @ -60,6 +60,7  @
     QRect thumbnailRect() const;
 
     virtual int compare(IconItem *item);
+    virtual QRect clickToOpenRect();
     
 protected:
 
 @ -70,6 +71,7  @
     ImageInfo           *info_;
     AlbumIconView       *view_;
     bool                 dirty_;
+    QRect                tightPixmapRect_;
 };
 
 
--- trunk/extragear/graphics/digikam/digikam/iconitem.cpp #455297:455298
 @ -83,6 +83,11  @
     return r;
 }
 
+QRect IconItem::clickToOpenRect()
+{
+    return rect();
+}
+
 bool IconItem::move(int x, int y)
 {
     if (m_x == x && m_y == y)
--- trunk/extragear/graphics/digikam/digikam/iconitem.h #455297:455298
 @ -51,6 +51,7  @
     IconView* iconView() const;
 
     virtual int compare(IconItem *item);
+    virtual QRect clickToOpenRect();
 
 protected:
 
--- trunk/extragear/graphics/digikam/digikam/iconview.cpp #455297:455298
 @ -53,7 +53,7  @
         currItem   = 0;
         anchorItem = 0;
         clearing   = false;
-        spacing    = 5;
+        spacing    = 10;
 
         rubber       = 0;
         dragging     = false;
 @ -982,7 +982,7  @
 
         if (KGlobalSettings::changeCursorOverIcon())
         {
-            if (item)
+            if (item && item->clickToOpenRect().contains(e->pos()))
                 setCursor(KCursor::handCursor());
             else
                 unsetCursor();
 @ -1127,7 +1127,12  @
             if (prevCurrItem)
                 prevCurrItem->repaint();
             if (KGlobalSettings::singleClick())
-                itemClickedToOpen(item);
+            {
+                if (item->clickToOpenRect().contains(e->pos()))
+                {
+                    itemClickedToOpen(item);
+                }
+            }
         }
     }
 }
--- trunk/extragear/graphics/digikam/digikam/thumbnailjob.cpp #455297:455298
 @ -280,8 +280,6  @
         QPainter p(&pix);
         p.setPen(QPen(QColor(0,0,0),1));
         p.drawRect(0,0,w,h);
-        p.setPen(QPen(QColor(255,255,255),1));
-        p.drawRect(1,1,w-2,h-2);
         p.end();
     }



More information about the Digikam-devel mailing list