summaryrefslogtreecommitdiffstats
path: root/smglobals.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-10-23 15:09:49 +0200
committerArno <am@disconnect.de>2010-10-23 15:09:49 +0200
commit7e0abc7cde4a9c02fabc27cc2b6506bd41f0588d (patch)
treedff223d42a9515f961ded35eaae9ceba77824580 /smglobals.cpp
parent9092371858356efde3e2d6d002f692308127389c (diff)
downloadSheMov-7e0abc7cde4a9c02fabc27cc2b6506bd41f0588d.tar.gz
SheMov-7e0abc7cde4a9c02fabc27cc2b6506bd41f0588d.tar.bz2
SheMov-7e0abc7cde4a9c02fabc27cc2b6506bd41f0588d.zip
Fix hover issues
Hopefully this commit fixes all issues with hovering over items. First, only use QCursor::pos() to determine the position of the hover window and fix position calculation accordingly. For that SmGlobals now return a QSize of the actual cursor size. Introduced a hoverOffeset to HoverWindow defaulting to SmGlobals::cursorSize() + 30 to prevent a HoverLeave event on showing the HoverWindow. Also fixed Qt::WindowFlags of HoverWindow. We don't want the HoverWindow to show in the taskbar or get sent to background when clicking on an item.
Diffstat (limited to 'smglobals.cpp')
-rw-r--r--smglobals.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/smglobals.cpp b/smglobals.cpp
index 84f0fd8..6b32527 100644
--- a/smglobals.cpp
+++ b/smglobals.cpp
@@ -84,13 +84,13 @@ PictureViewer *SmGlobals::pictureViewer() {
return mPictureViewer;
}
-int SmGlobals::cursorOffset() {
- if(mCursorOffset == -1){
+QSize SmGlobals::cursorSize() {
+ if(!mCursorSize.isValid()){
XFixesCursorImage *curImage = XFixesGetCursorImage(QX11Info::display());
- mCursorOffset = curImage->height;
+ mCursorSize = QSize(curImage->width, curImage->height);
XFree(curImage);
}
- return mCursorOffset;
+ return mCursorSize;
}
-SmGlobals::SmGlobals() : mPictureViewer(0), mCursorOffset(-1) {}
+SmGlobals::SmGlobals() : mPictureViewer(0) {}