| Summary: | Digikam: wish: popup image information only when over the thumbnail | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Achim Bohnet <ach> |
| Component: | Thumbs-Image | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | caulier.gilles, digikam-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 0.7.0 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 8.7.0 | |
| Sentry Crash Report: | |||
|
Description
Achim Bohnet
2004-09-04 01:04:19 UTC
Just for information, so this thing isn't implemented twice... I have implemented it today, but the commit has to wait until 0.7.2 is released, because we're in string freeze now. So be patient ;-) I let this wish open until i have committed the code. CVS commit by jahrens:
We just decided not to make this behavior configurable.
So it's possible to commit before 0.7.2 release.
Hey Achim, no more reason to walk in circles. Stop walking
and update ;-)
BUG: 88805
M +10 -0 albumiconitem.cpp 1.29
M +1 -0 albumiconitem.h 1.8
M +14 -1 albumiconview.cpp 1.109
M +2 -0 albumiconview.h 1.35
M +17 -2 thumbview.cpp 1.27
M +2 -0 thumbview.h 1.12
--- kdeextragear-3/digikam/digikam/albumiconitem.cpp #1.28:1.29
@@ -327,2 +327,12 @@ void AlbumIconItem::paintItem(QPainter *
}
+QRect AlbumIconItem::thumbnailRect()
+{
+ QRect pixmapRect = view_->itemPixmapRect();
+ QRect r = rect();
+
+ return QRect(r.x()+pixmapRect.x() + (pixmapRect.width()-thumbnail_.width())/2,
+ r.y()+pixmapRect.y() + (pixmapRect.height()-thumbnail_.height())/2,
+ thumbnail_.width(), thumbnail_.height());
+}
+
--- kdeextragear-3/digikam/digikam/albumiconitem.h #1.7:1.8
@@ -68,4 +68,5 @@ public:
void setPixmap(const QPixmap& thumb, const KFileMetaInfo* metaInfo);
+ QRect thumbnailRect();
virtual int compare(ThumbItem *item);
--- kdeextragear-3/digikam/digikam/albumiconview.cpp #1.108:1.109
@@ -1453,4 +1452,18 @@ void AlbumIconView::slotContentsMoving(i
}
+bool AlbumIconView::acceptToolTip(ThumbItem *item, const QPoint &mousePos)
+{
+ AlbumIconItem *iconItem = dynamic_cast<AlbumIconItem*>(item);
+
+ if(iconItem && iconItem->thumbnailRect().contains(mousePos))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
void AlbumIconView::slotShowToolTip(ThumbItem* item)
{
--- kdeextragear-3/digikam/digikam/albumiconview.h #1.34:1.35
@@ -122,4 +122,6 @@ protected:
void contentsDropEvent(QDropEvent *e);
+ bool acceptToolTip(ThumbItem *item, const QPoint &mousePos);
+
private:
--- kdeextragear-3/digikam/digikam/thumbview.cpp #1.26:1.27
@@ -773,4 +773,8 @@ void ThumbView::contentsMousePressEvent(
}
+bool ThumbView::acceptToolTip(ThumbItem *, const QPoint &)
+{
+ return true;
+}
void ThumbView::contentsMouseMoveEvent(QMouseEvent *e)
@@ -796,6 +800,9 @@ void ThumbView::contentsMouseMoveEvent(Q
{
d->toolTipItem = 0;
+ d->toolTipTimer->stop();
slotToolTip();
+ if(acceptToolTip(item, e->pos()))
+ {
d->toolTipItem = item;
d->toolTipTimer->start(500, true);
@@ -803,4 +810,12 @@ void ThumbView::contentsMouseMoveEvent(Q
}
+ if(item == d->toolTipItem && !acceptToolTip(item, e->pos()))
+ {
+ d->toolTipItem = 0;
+ d->toolTipTimer->stop();
+ slotToolTip();
+ }
+ }
+
if(KGlobalSettings::changeCursorOverIcon())
{
--- kdeextragear-3/digikam/digikam/thumbview.h #1.11:1.12
@@ -100,4 +100,6 @@ protected:
virtual void contentsDropEvent(QDropEvent *e);
+ virtual bool acceptToolTip(ThumbItem *item, const QPoint &mousePos);
+
private:
|