Hi

Here's a message I sent to the original author on 8/8/04 - no reply though :(


Filelight is nice - thanks :)


I have a couple of problems with tooltips though :( 1) I use a dual-headed xinerama setup and the tooltips always appear
on the left screen.
2) If you move filelight off the bottom of the screen so only about
the top half shows then the tooltips flicker madly when the mouse
moves over them.


I've attached a patch that fixes them.

I am not 100% confident I've done the right thing - the docs are
confusing.

Here is the main suggestion for the way I approached it:
http://doc.trolltech.com/3.2/qapplication.html#desktop

I think the QDesktopWidget::screenGeometry  methods apply to the
individual monitors (labelled screen 0 and screen 1) here:
http://doc.trolltech.com/3.2/qdesktopwidget.html#details

I can see no way to get the Xinerama screen layout (leftOf etc) from
the Qt methods.
Instead I think you have to use QApplication::desktop ()->geometry()

I think KGlobalSettings isn't right either; this:
http://developer.kde.org/documentation/library/cvs-api/kdecore/html/kglobalsettings_8cpp-source.html#l00630
suggests that it's more for popup placement - I think filelight needs
the dw->geometry approach no matter what the Xinerama settings are set
to :)


Anyway - it now works - HTH.

The tooltip flicker is simple geometry. As soon as the tooltip touches
the bottom of the screen then it now tries to placeAbove (I think the test
~         if (placeAbove)
~                 p.ry() -= y2 - sh;
~         else
is actually redundant - but your call)

David


--- segmenttip.cpp.orig 2004-01-13 21:40:55.000000000 +0000 +++ segmenttip.cpp 2004-08-08 13:52:47.000000000 +0100 @@ -64,9 +64,8 @@ ~ p.rx() -= rect().center().x(); ~ p.ry() -= (placeAbove ? 8 + height() : m_cursorHeight - 8);

-//**** use when using KDE 3.2
-//  static QRect KGlobalSettings::desktopGeometry(QWidget *w);
-  const QRect screen = QApplication::desktop()->screenGeometry(-1);
+  // This returns the full width of a screen (works for virtual
Xinerama too)
+  const QRect screen = QApplication::desktop()->geometry();

~   int x  = p.x();
~   int y  = p.y();
@@ -78,7 +77,12 @@
~   if( x  < 0  ) p.setX( 0 );
~   if( y  < 0  ) p.setY( 0 );
~   if( x2 > sw ) p.rx() -= x2 - sw;
-  if( y2 > sh ) p.ry() -= y2 - sh;
+  // Jump the tip upwards if we get to the bottom of the screen
(stops the mouse going over the tip and flickering)
+  if( y2 > sh )
+         if (placeAbove)
+                 p.ry() -= y2 - sh;
+         else
+                 p.ry() -= (height()*2 + m_cursorHeight - 16);


~ //I'm using this QPoint to determine where to offset the bitBlt in m_pixmap



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Reply via email to