mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 09:48:50 +00:00
homescreen: Port to use shared WindowPlugin for zoom anim
This commit is contained in:
parent
76b3c4ec4d
commit
1449ea7b4e
1 changed files with 7 additions and 33 deletions
|
|
@ -134,35 +134,6 @@ 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
|
// homescreen visual component
|
||||||
Components.BaseItem {
|
Components.BaseItem {
|
||||||
id: itemContainer
|
id: itemContainer
|
||||||
|
|
@ -205,7 +176,8 @@ Item {
|
||||||
|
|
||||||
function evaluateAnimChange() {
|
function evaluateAnimChange() {
|
||||||
// only animate if homescreen is visible
|
// only animate if homescreen is visible
|
||||||
if (!visibleMaximizedWindowsModel.isWindowMaximized || WindowPlugin.WindowUtil.activeWindowIsShell) {
|
console.log('EVAL');
|
||||||
|
if (!WindowPlugin.WindowMaximizedTracker.showingWindow || WindowPlugin.WindowUtil.activeWindowIsShell) {
|
||||||
itemContainer.zoomIn();
|
itemContainer.zoomIn();
|
||||||
} else {
|
} else {
|
||||||
itemContainer.zoomOut();
|
itemContainer.zoomOut();
|
||||||
|
|
@ -214,14 +186,16 @@ Item {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: WindowPlugin.WindowUtil
|
target: WindowPlugin.WindowUtil
|
||||||
|
|
||||||
function onActiveWindowIsShellChanged() {
|
function onActiveWindowIsShellChanged() {
|
||||||
itemContainer.evaluateAnimChange();
|
itemContainer.evaluateAnimChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: visibleMaximizedWindowsModel
|
target: WindowPlugin.WindowMaximizedTracker
|
||||||
function onIsWindowMaximizedChanged() {
|
|
||||||
|
function onShowingWindowChanged() {
|
||||||
itemContainer.evaluateAnimChange();
|
itemContainer.evaluateAnimChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue