Bug 92350 - Tooltip shown partly off screen
Summary: Tooltip shown partly off screen
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Ergonomy (show other bugs)
Version: 0.7.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-29 22:45 UTC by Marcel Wiesweg
Modified: 2022-01-20 04:19 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Wiesweg 2004-10-29 22:45:34 UTC
Version:           0.7-beta1 (using KDE 3.3.1, SuSE)
Compiler:          gcc version 3.3.1 (SuSE Linux)
OS:                Linux (i686) release 2.6.6

In CVS thumbnails are no longer drawn on top of the picture they refer to, and this is very good.
But there is a regression, now sometimes the tooltip is drawn with the upper part off screen.
Comment 1 Renchi Raju 2004-10-29 22:58:18 UTC
is there a specific set of conditions under which you can reproduce this. in the implementation, tooltip is repositioned once the text for it is laid out, so that the tooltip lies within the screen edges
Comment 2 Marcel Wiesweg 2004-10-29 23:50:26 UTC
Now that I tried to reproduce it I almost thought I could not, but I can reproduce it: With thumbnails 160x160, and three in a row, it happens after the 420th picture, 140th row.
The tooltip is always shown above the picture, even if it is entirely off screen.
Comment 3 Renchi Raju 2004-11-01 06:43:37 UTC
CVS commit by pahlibar: 


reposition tooltip with global mapping with respect to viewport. fixes 
tooltips being moved out of screen in case of very large content rect
BUG: 92350


  M +5 -3      albumfiletip.cpp   1.15


--- kdeextragear-3/digikam/digikam/albumfiletip.cpp  #1.14:1.15
@@ -95,6 +95,6 @@ void AlbumFileTip::reposition()
 
     QRect rect = m_iconItem->rect();
-    QPoint off = m_view->mapToGlobal( m_view->contentsToViewport( QPoint( 0, 0 ) ) );
-    rect.moveBy( off.x(), off.y() );
+    rect.moveTopLeft(m_view->contentsToViewport(rect.topLeft()));
+    rect.moveTopLeft(m_view->viewport()->mapToGlobal(rect.topLeft()));
 
     QPoint pos = rect.center();
@@ -130,9 +130,11 @@ void AlbumFileTip::reposition()
     {
         // above
-        pos.setY( rect.top() - height() );
+        pos.setY( rect.top() - height() - 5);
         m_corner += 2;
     }
     else
+    {
         pos.setY( rect.bottom() + 5 );
+    }
 
     move( pos );