diff options
Diffstat (limited to 'src-qt5/core')
-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;*/ |