diff options
author | Ken Moore <ken@ixsystems.com> | 2018-03-09 22:51:20 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-03-09 22:51:20 -0500 |
commit | c311d3688c2dc8175d627ddff8db2a7b729eb15e (patch) | |
tree | 9f5c6d5da2fdfe4b043f86cd365e2faba627ab87 /src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp | |
parent | undo the thing (diff) | |
download | lumina-c311d3688c2dc8175d627ddff8db2a7b729eb15e.tar.gz lumina-c311d3688c2dc8175d627ddff8db2a7b729eb15e.tar.bz2 lumina-c311d3688c2dc8175d627ddff8db2a7b729eb15e.zip |
Add the beginnings of the new window frame (widgets-based)
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp new file mode 100644 index 00000000..24ad3fda --- /dev/null +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp @@ -0,0 +1,48 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2018, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "NativeWindow.h" + +// === PUBLIC === +NativeWindow::NativeWindow( NativeWindowObject *obj ) : QFrame(0, Qt::Window | Qt::FramelessWindowHint){ + WIN = obj; + createFrame(); +} + +NativeWindow::~NativeWindow(){ + +} + +// === PRIVATE === +void NativeWindow::createFrame(){ + //Initialize the widgets + closeB = new QToolButton(this); + closeB->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + minB = new QToolButton(this); + minB->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + maxB = new QToolButton(this); + maxB->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + otherB = new QToolButton(this); + otherB->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + toolbarL = new QHBoxLayout(this); + vlayout = new QVBoxLayout(this); + vlayout.align + titleLabel = new QLabel(this); + titleLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + //Now put the widgets in the right places + toolbarL->addWidget(otherB); + toolbarL->addWidget(titleLabel); + toolbarL->addWidget(minB); + toolbarL->addWidget(maxB); + toolbarL->addWidget(closeB); + vlayout->addLayout(toolbarL); + vlayout->addStretch(); + this->setLayout(vlayout); + + // +} + +// === PRIVATE SLOTS === |