Bug 92350

Summary: Tooltip shown partly off screen
Product: [Applications] digikam Reporter: Marcel Wiesweg <marcel.wiesweg>
Component: Usability-ErgonomyAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 0.7.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 7.6.0
Sentry Crash Report:

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 );