aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/RootSubWindow-animations.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-31 08:47:21 -0400
committerKen Moore <ken@ixsystems.com>2017-08-31 08:47:21 -0400
commit0bce08ce5c6fa073b0c9e299ab619d35ecdceef6 (patch)
treeca819bd27c14ae05d6c65164f84f41cab3916430 /src-qt5/core/libLumina/RootSubWindow-animations.cpp
parentA couple more minor tweaks. (diff)
downloadlumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.tar.gz
lumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.tar.bz2
lumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.zip
A but more work on Lumina2:
1. Get the menu-based task manager up and running. 2. Get the minimize button setup with normal functionality now (since we can restore it) 3. Get the maximize button logic setup - still testing this 4. Get the window movement animation system setup - still testing this for the maximize functionality 5. Cleanup a bit more of the backend "pause" for windows during animations.
Diffstat (limited to 'src-qt5/core/libLumina/RootSubWindow-animations.cpp')
-rw-r--r--src-qt5/core/libLumina/RootSubWindow-animations.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/RootSubWindow-animations.cpp b/src-qt5/core/libLumina/RootSubWindow-animations.cpp
index ac813e3a..b1489ad6 100644
--- a/src-qt5/core/libLumina/RootSubWindow-animations.cpp
+++ b/src-qt5/core/libLumina/RootSubWindow-animations.cpp
@@ -11,6 +11,9 @@ QStringList RootSubWindow::validAnimations(NativeWindow::Property prop){
QStringList valid;
if(prop == NativeWindow::Visible){
valid << "zoom" << "wipe-center-vertical" << "wipe-center-horizontal" << "shade-top" << "shade-right" << "shade-left" << "shade-bottom";
+ }else if(prop == NativeWindow::Size){
+ //Note: this is used for pretty much all geometry changes to the window where it is visible both before/after animation
+ valid << "direct";
}
return valid;
}
@@ -20,7 +23,7 @@ void RootSubWindow::loadAnimation(QString name, NativeWindow::Property prop, QVa
//Special case - random animation each time
if(name=="random"){
QStringList valid = validAnimations(prop);
- name = valid.at(qrand()%valid.length());
+ if(!valid.isEmpty()){ name = valid.at(qrand()%valid.length()); }
}
//Now setup the animation
if(prop == NativeWindow::Visible){
@@ -68,6 +71,20 @@ void RootSubWindow::loadAnimation(QString name, NativeWindow::Property prop, QVa
anim->start();
this->show();
} //end of Visibility animation
+ else if(prop == NativeWindow::Size){
+ //This is pretty much all geometry animations where the window is visible->visible
+ animResetProp = QVariant(); //reset this - not needed here
+ anim->setPropertyName("geometry");
+ anim->setStartValue(this->geometry());
+ anim->setEndValue(nval.toRect());
+ /*if(name==""){
+ // TO-DO modify the path from beginning->end somehow
+ }*/
+ // Now start the animation
+ WinWidget->pause();
+ anim->start();
+ this->show();
+ }
}
void RootSubWindow::animFinished(){
@@ -92,6 +109,6 @@ void RootSubWindow::animFinished(){
}
}
animResetProp = QVariant(); //clear the variable
- WinWidget->resume();
+ QTimer::singleShot(10, WinWidget, SLOT(resume()) );
}
bgstack15