diff options
author | Weblate <noreply@weblate.org> | 2017-07-27 16:17:01 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-07-27 16:17:01 +0000 |
commit | f9117e2749fdc01ad3ba5d0ae6623bd253d973bf (patch) | |
tree | 4e7bb581dc9a2656b01440256c09eeb2fccad65d /src-qt5/core/libLumina/NativeWindow.cpp | |
parent | Translated using Weblate (Spanish) (diff) | |
parent | Merge branch 'master' of https://github.com/trueos/lumina (diff) | |
download | lumina-f9117e2749fdc01ad3ba5d0ae6623bd253d973bf.tar.gz lumina-f9117e2749fdc01ad3ba5d0ae6623bd253d973bf.tar.bz2 lumina-f9117e2749fdc01ad3ba5d0ae6623bd253d973bf.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 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src-qt5/core/libLumina/NativeWindow.cpp b/src-qt5/core/libLumina/NativeWindow.cpp index 48d0380b..3c76ed00 100644 --- a/src-qt5/core/libLumina/NativeWindow.cpp +++ b/src-qt5/core/libLumina/NativeWindow.cpp @@ -86,7 +86,16 @@ 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; |