diff options
author | Ken Moore <ken@ixsystems.com> | 2017-06-29 14:42:08 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-06-29 14:42:08 -0400 |
commit | acfb339551b824f1e89c24364df9c9f330fd8549 (patch) | |
tree | 084cd4a399104715e8f91f0bf7a55ab96823158e /src-qt5/core/libLumina/RootSubWindow.cpp | |
parent | Try to fix up some window close/re-open issues (diff) | |
download | lumina-acfb339551b824f1e89c24364df9c9f330fd8549.tar.gz lumina-acfb339551b824f1e89c24364df9c9f330fd8549.tar.bz2 lumina-acfb339551b824f1e89c24364df9c9f330fd8549.zip |
Some more fixes for the window animations
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow.cpp')
-rw-r--r-- | src-qt5/core/libLumina/RootSubWindow.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src-qt5/core/libLumina/RootSubWindow.cpp b/src-qt5/core/libLumina/RootSubWindow.cpp index eae5aa39..80d5c82b 100644 --- a/src-qt5/core/libLumina/RootSubWindow.cpp +++ b/src-qt5/core/libLumina/RootSubWindow.cpp @@ -202,7 +202,12 @@ void RootSubWindow::LoadProperties( QList< NativeWindow::Property> list){ void RootSubWindow::clientClosed(){ qDebug() << "Client Closed"; closing = true; - this->close(); + anim->setPropertyName("geometry"); + anim->setStartValue(this->geometry()); + anim->setEndValue( QRect(this->geometry().center(), QSize(0,0) ) ); + anim->start(); + QTimer::singleShot(anim->duration(), this, SLOT(close()) ); + //this->close(); } void RootSubWindow::LoadAllProperties(){ @@ -266,8 +271,8 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList if(vals[i].toBool()){ WinWidget->setVisible(true); anim->setPropertyName("geometry"); - anim->setStartValue( QRect(this->geometry().center(), QSize(0,0)) ); - anim->setEndValue(this->geometry()); + anim->setStartValue( QRect(WIN->geometry().center(), QSize(0,0)) ); + anim->setEndValue(WIN->geometry()); anim->start(); this->show(); }else{ @@ -284,7 +289,7 @@ void RootSubWindow::propertiesChanged(QList<NativeWindow::Property> props, QList break; case NativeWindow::Icon: //qDebug() << "Got Icon Change:" << vals[i]; - if(vals[i].value<QIcon>().isNull() ){ LIconCache::instance()->loadIcon(otherB, "window-close"); } + if(vals[i].value<QIcon>().isNull() ){ LIconCache::instance()->loadIcon(otherB, "list"); } else{ otherB->setIcon(vals[i].value<QIcon>()); } break; case NativeWindow::GlobalPos: @@ -448,7 +453,7 @@ void RootSubWindow::leaveEvent(QEvent *ev){ void RootSubWindow::resizeEvent(QResizeEvent *ev){ //qDebug() << "Got Resize Event:" << ev->size(); - if(WinWidget->size() != WIN->property(NativeWindow::Size).toSize()){ + if(WinWidget->size() != WIN->property(NativeWindow::Size).toSize() && anim->state()!=QAbstractAnimation::Running){ WIN->requestProperty(NativeWindow::Size, WinWidget->size()); } QFrame::resizeEvent(ev); @@ -461,6 +466,6 @@ void RootSubWindow::resizeEvent(QResizeEvent *ev){ void RootSubWindow::moveEvent(QMoveEvent *ev){ //qDebug() << "Got Move Event:" << ev->pos() << WinWidget->mapToGlobal(QPoint(0,0)); - WIN->setProperty(NativeWindow::GlobalPos, WinWidget->mapToGlobal(QPoint(0,0)) ); + if(!closing && anim->state()!=QAbstractAnimation::Running){ WIN->setProperty(NativeWindow::GlobalPos, WinWidget->mapToGlobal(QPoint(0,0)) ); } QFrame::moveEvent(ev); } |