From 44f14e37bd0ad573590d92cc6e1052b8d8711021 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 29 Jun 2017 11:16:20 -0400 Subject: Clean up the handling of the frameExtents property quite a bit. --- src-qt5/core/libLumina/RootSubWindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/libLumina') diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp index f17ee9a1..213e07ca 100644 --- a/src-qt5/core/libLumina/RootSubWindow.cpp +++ b/src-qt5/core/libLumina/RootSubWindow.cpp @@ -162,7 +162,7 @@ void RootSubWindow::initWindowFrame(){ titleLabel->setObjectName("Label_Title"); this->setStyleSheet("QWidget#WindowFrame{background-color: rgba(0,0,0,125);} QWidget#Label_Title{background-color: transparent; color: white; }"); //And adjust the margins - mainLayout->setContentsMargins(WIN_BORDER,WIN_BORDER,WIN_BORDER,WIN_BORDER); + mainLayout->setContentsMargins(WIN_BORDER,WIN_BORDER,WIN_BORDER,WIN_BORDER); //default border mainLayout->setSpacing(0); titleBar->setSpacing(1); titleBar->setContentsMargins(0,0,0,0); @@ -175,6 +175,13 @@ void RootSubWindow::LoadProperties( QList< NativeWindow::Property> list){ for(int i=0; iproperty(list[i]); + if(list[i] == NativeWindow::FrameExtents){ + if(vals[i].isNull()){ + QList frame; frame << WIN_BORDER << WIN_BORDER << WIN_BORDER+titleLabel->height() << WIN_BORDER; + vals[i] = QVariant::fromValue< QList >(frame); //use this by default + WIN->requestProperty(NativeWindow::FrameExtents, QVariant::fromValue< QList >(frame)); //make sure these values get saved permanently + } + } qDebug() << "Property:" << list[i] << vals[i]; } propertiesChanged(list, vals); @@ -276,6 +283,9 @@ void RootSubWindow::propertiesChanged(QList props, QList case NativeWindow::Active: //if(vals[i].toBool()){ WinWidget->setFocus(); } break; + case NativeWindow::FrameExtents: + mainLayout->setContentsMargins( vals[i].value< QList >().at(0),vals[i].value< QList >().at(2) - titleLabel->height(),vals[i].value< QList >().at(1),vals[i].value< QList >().at(3)); + break; /*case NativeWindow::WindowFlags: this->setWindowFlags( val.value< Qt::WindowFlags >() ); break;*/ -- cgit