diff options
author | Ken Moore <ken@ixsystems.com> | 2017-03-02 19:28:05 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-03-02 19:28:05 -0500 |
commit | 00d95d8a1323a4c0603a7a6f622c1b5cc981d2ce (patch) | |
tree | 6b49932d76a45009855acceaae687e153bed0f8f /src-qt5/core/libLumina/RootSubWindow.h | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-00d95d8a1323a4c0603a7a6f622c1b5cc981d2ce.tar.gz lumina-00d95d8a1323a4c0603a7a6f622c1b5cc981d2ce.tar.bz2 lumina-00d95d8a1323a4c0603a7a6f622c1b5cc981d2ce.zip |
Write up a new window frame for Lumina2 (not using the QMdi[Sub]Window classes). This seems to be working much better so far - still need to finish filling out the various interaction functions and themeing (stylesheet object names done).
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow.h')
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.h | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src-qt5/core/libLumina/RootSubWindow.h b/src-qt5/core/libLumina/RootSubWindow.h index c56f3c96..fcf0fdae 100644 --- a/src-qt5/core/libLumina/RootSubWindow.h +++ b/src-qt5/core/libLumina/RootSubWindow.h @@ -10,41 +10,67 @@ #ifndef _LUMINA_ROOT_WINDOW_SUB_WINDOW_H #define _LUMINA_ROOT_WINDOW_SUB_WINDOW_H -#include <QMdiArea> -#include <QMdiSubWindow> #include <QWindow> #include <QWidget> #include <QCloseEvent> - +#include <QFrame> +#include <QBoxLayout> +#include <QLabel> +#include <QToolButton> +#include <QMenu> #include <NativeWindow.h> -class RootSubWindow : public QMdiSubWindow{ +class RootSubWindow : public QFrame{ Q_OBJECT public: - RootSubWindow(QMdiArea *root, NativeWindow *win); + RootSubWindow(QWidget *root, NativeWindow *win); ~RootSubWindow(); WId id(); private: + //Window status + enum ModState{Normal, Move, ResizeTop, ResizeTopRight, ResizeRight, ResizeBottomRight, ResizeBottom, ResizeBottomLeft, ResizeLeft, ResizeTopLeft}; + ModState activeState; + 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 + //Native window embed objects NativeWindow *WIN; QWidget *WinWidget; bool closing; + //Title bar objects + QBoxLayout *titleBar, *mainLayout; + QToolButton *closeB, *maxB, *minB; + QLabel *titleLabel; + QMenu *otherM; //menu of other actions + void initWindowFrame(); void LoadProperties( QList< NativeWindow::Property> list); public slots: void clientClosed(); + + //Button Actions - public so they can be tied to key shortcuts and stuff as well + void toggleMinimize(); + void toggleMaximize(); + void triggerClose(); + void toggleSticky(); + void activate(); + + //Mouse Interactivity + void startMoving(); + void startResizing(); private slots: - void clientHidden(); - void clientShown(); void aboutToActivate(); void propertyChanged(NativeWindow::Property, QVariant); - protected: - void closeEvent(QCloseEvent*); + void mousePressEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); }; |