diff options
author | Weblate <noreply@weblate.org> | 2017-07-27 16:21:54 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-07-27 16:21:54 +0000 |
commit | 66dcbf09c20382625f4e30aeadfef972f9d4cd9a (patch) | |
tree | 3fc81b9b38bc0c4d0fced646fce80c57c96a3c00 /src-qt5/core/libLumina/NativeWindow.cpp | |
parent | Translated using Weblate (Spanish) (diff) | |
parent | Merge remote-tracking branch 'origin/master' (diff) | |
download | lumina-66dcbf09c20382625f4e30aeadfef972f9d4cd9a.tar.gz lumina-66dcbf09c20382625f4e30aeadfef972f9d4cd9a.tar.bz2 lumina-66dcbf09c20382625f4e30aeadfef972f9d4cd9a.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/NativeWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/NativeWindow.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 94d39cb7..3c76ed00 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -86,14 +86,23 @@ void NativeWindow::requestProperties(QList<NativeWindow::Property> props, QList< QRect NativeWindow::geometry(){ //Calculate the "full" geometry of the window + frame (if any) - QRect geom( hash.value(NativeWindow::GlobalPos).toPoint(), hash.value(NativeWindow::Size).toSize() ); + //Check that the size is between the min/max limitations + QSize size = hash.value(NativeWindow::Size).toSize(); + QSize min = hash.value(NativeWindow::MinSize).toSize(); + QSize max = hash.value(NativeWindow::MaxSize).toSize(); + if(min.isValid() && min.width() > size.width() ){ size.setWidth(min.width()); } + if(min.isValid() && min.height() > size.height()){ size.setHeight(min.height()); } + if(max.isValid() && max.width() < size.width() && max.width()>min.width()){ size.setWidth(max.width()); } + if(max.isValid() && max.height() < size.height() && max.height()>min.height()){ size.setHeight(max.height()); } + //Assemble the full geometry + QRect geom( hash.value(NativeWindow::GlobalPos).toPoint(), size ); //Now adjust the window geom by the frame margins QList<int> frame = hash.value(NativeWindow::FrameExtents).value< QList<int> >(); //Left,Right,Top,Bottom - qDebug() << "Calculate Geometry:" << geom << frame; + //qDebug() << "Calculate Geometry:" << geom << frame; if(frame.length()==4){ geom = geom.adjusted( -frame[0], -frame[2], frame[1], frame[3] ); } - qDebug() << " - Total:" << geom; + //qDebug() << " - Total:" << geom; return geom; } // ==== PUBLIC SLOTS === |