mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
homescreen: Don't play zoom animation when going between maximized window states
This commit is contained in:
parent
a607fc2600
commit
eff9d3df9a
2 changed files with 48 additions and 18 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue