aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-06-05 12:16:08 -0400
committerKen Moore <ken@ixsystems.com>2018-06-05 12:16:08 -0400
commit4b303bd5dfcb49c6be0e9e1607134b21de8fbf1a (patch)
tree506340fbaeebe7ad35c6a9f1e898d1377fb3b999 /src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
parentFix up the window frame borders. (diff)
downloadlumina-4b303bd5dfcb49c6be0e9e1607134b21de8fbf1a.tar.gz
lumina-4b303bd5dfcb49c6be0e9e1607134b21de8fbf1a.tar.bz2
lumina-4b303bd5dfcb49c6be0e9e1607134b21de8fbf1a.zip
Get the window movement working, and mouse cursor changes on mouseover working as well.
Resizing a window will crash things at the moment - still looking into that...
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
index 47699ae6..20491014 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.h
@@ -21,8 +21,21 @@ public:
public slots:
void initProperties();
+ //Mouse Interactivity
+ void startMoving();
+ void startResizing();
private:
+ //Window status
+ enum ModState{Normal, Move, ResizeTop, ResizeTopRight, ResizeRight, ResizeBottomRight, ResizeBottom, ResizeBottomLeft, ResizeLeft, ResizeTopLeft};
+ ModState activeState;
+ ModState currentCursor;
+ QPoint offset; //needed for movement calculations (offset from mouse click to movement point)
+ //Functions for getting/setting state
+ ModState getStateAtPoint(QPoint pt, bool setoffset = false); //generally used for mouse location detection
+ void setMouseCursor(ModState, bool override = false); //Update the mouse cursor based on state
+ QTimer *moveTimer;
+
//Core object
NativeWindowObject *WIN;
// Interface items
@@ -49,6 +62,18 @@ private slots:
void syncVisibility(bool init = false);
void syncWinType();
void syncGeom();
+
+protected:
+ void mousePressEvent(QMouseEvent*);
+ void mouseMoveEvent(QMouseEvent*);
+ void mouseReleaseEvent(QMouseEvent*);
+ void leaveEvent(QEvent *ev);
+ //void enterEvent(QEvent *ev);
+ void moveEvent(QMoveEvent *ev);
+
+signals:
+ void windowMoved(NativeWindowObject*);
+
};
#endif
bgstack15