aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/RootSubWindow.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-07-18 18:56:59 -0400
committerKen Moore <ken@ixsystems.com>2017-07-18 18:58:15 -0400
commit6331ded27b98c14295f7e7367b321e97366ad897 (patch)
treedf8e00a4177833839d1294c5a2086cd26e059e71 /src-qt5/core/libLumina/RootSubWindow.cpp
parentset proper define for datadir (diff)
downloadlumina-6331ded27b98c14295f7e7367b321e97366ad897.tar.gz
lumina-6331ded27b98c14295f7e7367b321e97366ad897.tar.bz2
lumina-6331ded27b98c14295f7e7367b321e97366ad897.zip
Get the resize/movement functionality all finished.
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow.cpp')
-rw-r--r--src-qt5/core/libLumina/RootSubWindow.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp
index d4c0ceeb..a759dc09 100644
--- a/src-qt5/core/libLumina/RootSubWindow.cpp
+++ b/src-qt5/core/libLumina/RootSubWindow.cpp
@@ -311,7 +311,8 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList
case NativeWindow::Visible:
//qDebug() << "Got Visibility Change:" << vals[i] << this->geometry() << WIN->geometry();
if(vals[i].toBool()){
- animResetProp = WIN->geometry(); //this->geometry();
+ if(lastGeom.isNull()){ animResetProp = WIN->geometry(); }
+ else{ animResetProp = lastGeom; }
anim->setPropertyName("geometry");
anim->setStartValue( QRect(animResetProp.toRect().center(), QSize(0,0)) );
anim->setEndValue(animResetProp);
@@ -320,6 +321,7 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList
this->show();
}else{
animResetProp = this->geometry(); //hide event - should already be the right geom
+ lastGeom = this->geometry();
anim->setPropertyName("geometry");
anim->setStartValue(this->geometry());
anim->setEndValue( QRect(this->geometry().center(), QSize(0,0) ) );
@@ -337,21 +339,25 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList
break;
case NativeWindow::GlobalPos:
//qDebug() << "Got Global Pos:" << this->pos() << WinWidget->mapToGlobal(QPoint(0,0)) << WIN->geometry().topLeft() << vals[i].toPoint();
- this->move( vals[i].toPoint() - (WinWidget->mapToGlobal(QPoint(0,0)) - this->pos()) ); //WIN->geometry().topLeft() );
+ if(activeState == RootSubWindow::Normal){
+ this->move( vals[i].toPoint() - (WinWidget->mapToGlobal(QPoint(0,0)) - this->pos()) ); //WIN->geometry().topLeft() );
+ }
break;
case NativeWindow::Size:
- qDebug() << " - SIZE CHANGE";
- if(WIN->property(NativeWindow::FrameExtents).isNull() && (i<props.indexOf(NativeWindow::FrameExtents)) ){
- //Frame not loaded yet - push this back until after the frame is set
- props << props.takeAt(i);
- vals << vals.takeAt(i);
- i--;
- }else if(anim->state() != QPropertyAnimation::Running){
- if(vals[i].toSize() != WinWidget->size()){
- qDebug() << "Got Widget Size Change:" << vals[i].toSize() << WinWidget->size();
- WinWidget->resize(vals[i].toSize());
- this->resize( WIN->geometry().size() );
- qDebug() << " - Size after change:" << WinWidget->size() << this->size() << WIN->geometry();
+ //qDebug() << " - SIZE CHANGE";
+ if(activeState == RootSubWindow::Normal){
+ if(WIN->property(NativeWindow::FrameExtents).isNull() && (i<props.indexOf(NativeWindow::FrameExtents)) ){
+ //Frame not loaded yet - push this back until after the frame is set
+ props << props.takeAt(i);
+ vals << vals.takeAt(i);
+ i--;
+ }else if(anim->state() != QPropertyAnimation::Running){
+ if(vals[i].toSize() != WinWidget->size()){
+ //qDebug() << "Got Widget Size Change:" << vals[i].toSize() << WinWidget->size();
+ WinWidget->resize(vals[i].toSize());
+ this->resize( WIN->geometry().size() );
+ //qDebug() << " - Size after change:" << WinWidget->size() << this->size() << WIN->geometry();
+ }
}
}
break;
bgstack15