From f10a0a63e699288f1288c193c49795cae9cb3b40 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 16 Oct 2010 12:47:49 +0200 Subject: 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. --- smglobals.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'smglobals.cpp') diff --git a/smglobals.cpp b/smglobals.cpp index e70da89..84f0fd8 100644 --- a/smglobals.cpp +++ b/smglobals.cpp @@ -11,6 +11,10 @@ #include #include +#include +#include +#include + #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) {} -- cgit v1.2.3-70-g09d2