[Digikam-devel] [Bug 145227] change ratings via short-cuts in the light-table

Gilles Caulier caulier.gilles at gmail.com
Thu May 10 11:33:26 BST 2007


------- 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=145227         




------- Additional Comments From caulier.gilles gmail com  2007-05-10 12:33 -------
SVN commit 663163 by cgilles:

digikam from trunk : Light Table : add an icon over the thumbbar icon to indicate the position of image on Left or Right panel.
CCBUGS: 145227

 M  +76 -9     lighttablebar.cpp  
 M  +12 -1     lighttablebar.h  
 M  +10 -0     lighttablewindow.cpp  


--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablebar.cpp #663162:663163
 @ -107,6 +107,36  @
     }
 }
 
+void LightTableBar::setOnLeftPanel(const ImageInfo* info)
+{
+    if (!info) return;
+
+    for (ThumbBarItem *item = firstItem(); item; item = item->next())
+    {
+        KURL url1 = item->url();
+        KURL url2 = info->kurl();
+        LightTableBarItem *ltItem = static_cast<LightTableBarItem*>(item);
+        ltItem->setOnLeftPanel(url1 == url2);
+    }
+
+    triggerUpdate();
+}
+
+void LightTableBar::setOnRightPanel(const ImageInfo* info)
+{
+    if (!info) return;
+
+    for (ThumbBarItem *item = firstItem(); item; item = item->next())
+    {
+        KURL url1 = item->url();
+        KURL url2 = info->kurl();
+        LightTableBarItem *ltItem = static_cast<LightTableBarItem*>(item);
+        ltItem->setOnRightPanel(url1 == url2);
+    }
+
+    triggerUpdate();
+}
+
 void LightTableBar::slotItemSelected(ThumbBarItem* i)
 {
     if (i)
 @ -148,18 +178,20  @
 
 LightTableBarItem* LightTableBar::findItemByInfo(const ImageInfo* info) const
 {
-    for (ThumbBarItem *item = firstItem(); item; item = item->next())
+    if (info)
     {
-        KURL url1 = item->url();
-        KURL url2 = info->kurl();
-    
-        if (url1 == url2)
+        for (ThumbBarItem *item = firstItem(); item; item = item->next())
         {
-            LightTableBarItem *ltItem = static_cast<LightTableBarItem*>(item);
-            return ltItem;
+            KURL url1 = item->url();
+            KURL url2 = info->kurl();
+        
+            if (url1 == url2)
+            {
+                LightTableBarItem *ltItem = static_cast<LightTableBarItem*>(item);
+                return ltItem;
+            }
         }
     }
-
     return 0;
 }
 
 @ -281,6 +313,19  @
                     int x = (tile.width() - pix.width())/2;
                     int y = (tile.height()- pix.height())/2;
                     bitBlt(&tile, x, y, &pix);
+
+                    LightTableBarItem *ltItem = static_cast<LightTableBarItem*>(item);
+    
+                    if (ltItem->getOnLeftPanel())
+                    {
+                        QPixmap lPix = SmallIcon("previous"); 
+                        bitBlt(&tile, getMargin(), getMargin(), &lPix);
+                    }
+                    if (ltItem->getOnRightPanel())
+                    {
+                        QPixmap rPix = SmallIcon("next"); 
+                        bitBlt(&tile, tile.width() - getMargin() - rPix.width(), getMargin(), &rPix);
+                    }
                 }
                 
                 bitBlt(&bgPix, item->position() - cx, 0, &tile);
 @ -381,7 +426,9  @
 LightTableBarItem::LightTableBarItem(LightTableBar *view, ImageInfo *info)
                  : ThumbBarItem(view, info->kurl())
 {
-    m_info = info;
+    m_info         = info;
+    m_onLeftPanel  = false;
+    m_onRightPanel = false;
 }
 
 LightTableBarItem::~LightTableBarItem()
 @ -393,6 +440,26  @
     return m_info;
 }
 
+void LightTableBarItem::setOnLeftPanel(bool on)
+{
+    m_onLeftPanel = on;
+}
+
+void LightTableBarItem::setOnRightPanel(bool on)
+{
+    m_onRightPanel = on;
+}
+
+bool LightTableBarItem::getOnLeftPanel() const
+{
+    return m_onLeftPanel;
+}
+
+bool LightTableBarItem::getOnRightPanel() const
+{
+    return m_onRightPanel;
+}
+
 // -------------------------------------------------------------------------
 
 LightTableBarToolTip::LightTableBarToolTip(ThumbBarView* parent)
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablebar.h #663162:663163
 @ -63,6 +63,9  @
     /** Read tool tip settings from Album Settings instance */
     void readToolTipSettings();
 
+    void setOnLeftPanel(const ImageInfo* info);
+    void setOnRightPanel(const ImageInfo* info);
+
 signals:
 
     void signalLightTableBarItemSelected(ImageInfo*);
 @ -101,10 +104,18  @
     ~LightTableBarItem();
 
     ImageInfo* info();
+
+    void setOnLeftPanel(bool on);
+    void setOnRightPanel(bool on);
+    bool getOnLeftPanel() const;
+    bool getOnRightPanel() const;
     
 private:
 
-    ImageInfo   *m_info;
+    bool       m_onLeftPanel;
+    bool       m_onRightPanel;
+ 
+    ImageInfo *m_info;
 
     friend class LightTableBar;
 };
--- trunk/extragear/graphics/digikam/utilities/lighttable/lighttablewindow.cpp #663162:663163
 @ -527,12 +527,22  @
 {
     d->leftZoomBar->setEnabled(b);
     d->previewView->checkForSelection(d->barView->currentItemImageInfo());
+    d->barView->setOnLeftPanel(d->previewView->leftImageInfo());
+
+    LightTableBarItem *item = d->barView->findItemByInfo(d->previewView->leftImageInfo());
+    if (item) item->setOnLeftPanel(true);
+    d->barView->update();
 }
 
 void LightTableWindow::slotRightPreviewLoaded(bool b)
 {
     d->rightZoomBar->setEnabled(b);
     d->previewView->checkForSelection(d->barView->currentItemImageInfo());
+    d->barView->setOnRightPanel(d->previewView->rightImageInfo());
+
+    LightTableBarItem *item = d->barView->findItemByInfo(d->previewView->rightImageInfo());
+    if (item) item->setOnRightPanel(true);
+    d->barView->update();
 }
 
 void LightTableWindow::slotFileMetadataChanged(const KURL &/*url*/)



More information about the Digikam-devel mailing list