diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-29 11:16:20 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-29 11:16:20 -0400 |
commit | 44f14e37bd0ad573590d92cc6e1052b8d8711021 (patch) | |
tree | 82b94be4b322e590e27f41ecd82303c0cdf2d473 /src-qt5/core/libLumina/RootSubWindow.cpp | |
parent | Ensure that the Global Position (and Size) properties *always* reference the ... (diff) | |
download | lumina-44f14e37bd0ad573590d92cc6e1052b8d8711021.tar.gz lumina-44f14e37bd0ad573590d92cc6e1052b8d8711021.tar.bz2 lumina-44f14e37bd0ad573590d92cc6e1052b8d8711021.zip |
Clean up the handling of the frameExtents property quite a bit.
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; i<list.length(); i++){ if(list[i] == NativeWindow::Visible){ list.removeAt(i); i--; continue; } vals << WIN->property(list[i]); + if(list[i] == NativeWindow::FrameExtents){ + if(vals[i].isNull()){ + QList<int> frame; frame << WIN_BORDER << WIN_BORDER << WIN_BORDER+titleLabel->height() << WIN_BORDER; + vals[i] = QVariant::fromValue< QList<int> >(frame); //use this by default + WIN->requestProperty(NativeWindow::FrameExtents, QVariant::fromValue< QList<int> >(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<NativeWindow::Property> props, QList case NativeWindow::Active: //if(vals[i].toBool()){ WinWidget->setFocus(); } break; + case NativeWindow::FrameExtents: + mainLayout->setContentsMargins( vals[i].value< QList<int> >().at(0),vals[i].value< QList<int> >().at(2) - titleLabel->height(),vals[i].value< QList<int> >().at(1),vals[i].value< QList<int> >().at(3)); + break; /*case NativeWindow::WindowFlags: this->setWindowFlags( val.value< Qt::WindowFlags >() ); break;*/ |