aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeWindow.cpp
blob: 24ad3fda6e00bee817590b7256c660dd778ae5b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 ===
bgstack15