Commit eff9d3df authored by Devin Lin's avatar Devin Lin 🎨
Browse files

homescreen: Don't play zoom animation when going between maximized window states

parent a607fc26
Pipeline #196211 passed with stage
in 1 minute and 24 seconds
......@@ -102,6 +102,35 @@ Item {
}
}
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
}
PlasmaCore.SortFilterModel {
id: visibleMaximizedWindowsModel
readonly property bool isWindowMaximized: count > 0
filterRole: 'IsMinimized'
filterRegExp: 'false'
sourceModel: TaskManager.TasksModel {
id: tasksModel
filterByVirtualDesktop: true
filterByActivity: true
filterNotMaximized: true
filterByScreen: true
filterHidden: true
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
groupMode: TaskManager.TasksModel.GroupDisabled
}
}
// homescreen visual component
MobileShell.BaseItem {
id: itemContainer
......@@ -142,18 +171,28 @@ Item {
easing.type: Easing.OutExpo
}
function evaluateAnimChange() {
// only animate if homescreen is visible
if (!taskSwitcher.visible) {
if (!visibleMaximizedWindowsModel.isWindowMaximized || MobileShell.WindowUtil.activeWindowIsShell) {
itemContainer.zoomIn();
} else {
itemContainer.zoomOut();
}
}
}
Connections {
target: MobileShell.WindowUtil
function onActiveWindowIsShellChanged() {
// only animate if homescreen is visible
if (!taskSwitcher.visible) {
if (MobileShell.WindowUtil.activeWindowIsShell) {
itemContainer.zoomIn();
} else {
itemContainer.zoomOut();
}
}
itemContainer.evaluateAnimChange();
}
}
Connections {
target: visibleMaximizedWindowsModel
function onIsWindowMaximizedChanged() {
itemContainer.evaluateAnimChange();
}
}
......@@ -179,14 +218,6 @@ Item {
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
}
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
}
anchors.fill: parent
......
......@@ -128,7 +128,6 @@ PlasmaCore.ColorScope {
filterByScreen: true
filterHidden: true
// screenGeometry: panel.screenGeometry
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment