summaryrefslogtreecommitdiffstats
path: root/smglobals.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-10-16 12:47:49 +0200
committerArno <am@disconnect.de>2010-10-16 12:47:49 +0200
commitf10a0a63e699288f1288c193c49795cae9cb3b40 (patch)
treea4bd7c83440223a2eeec787f8f50c070e34fbe72 /smglobals.cpp
parent101cc9ec266a2d3b5168ab5053efbf868be7e25b (diff)
downloadSheMov-f10a0a63e699288f1288c193c49795cae9cb3b40.tar.gz
SheMov-f10a0a63e699288f1288c193c49795cae9cb3b40.tar.bz2
SheMov-f10a0a63e699288f1288c193c49795cae9cb3b40.zip
Created general purpose HoverWidget
This commit outsources the HoverWindow to a seperate file and makes it possible to set a pixmap to the window. Also the cursor offset is only calculated once in SmGlobals.
Diffstat (limited to 'smglobals.cpp')
-rw-r--r--smglobals.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/smglobals.cpp b/smglobals.cpp
index e70da89..84f0fd8 100644
--- a/smglobals.cpp
+++ b/smglobals.cpp
@@ -11,6 +11,10 @@
#include <QMessageBox>
#include <QSettings>
+#include <QX11Info>
+#include <X11/Xlib.h>
+#include <X11/extensions/Xfixes.h>
+
#include "smglobals.h"
#include "seriestreemodel.h"
#include "filestreemodel.h"
@@ -80,4 +84,13 @@ PictureViewer *SmGlobals::pictureViewer() {
return mPictureViewer;
}
-SmGlobals::SmGlobals() : mPictureViewer(0) {}
+int SmGlobals::cursorOffset() {
+ if(mCursorOffset == -1){
+ XFixesCursorImage *curImage = XFixesGetCursorImage(QX11Info::display());
+ mCursorOffset = curImage->height;
+ XFree(curImage);
+ }
+ return mCursorOffset;
+}
+
+SmGlobals::SmGlobals() : mPictureViewer(0), mCursorOffset(-1) {}