mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
taskswitcher: Remove global variable calls
This commit is contained in:
parent
7d4cfef693
commit
0dae893cd2
3 changed files with 20 additions and 21 deletions
|
|
@ -46,7 +46,7 @@ Item {
|
|||
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: taskSwitcher.model
|
||||
model: taskSwitcher.tasksModel
|
||||
|
||||
// left margin from root edge such that the task is centered
|
||||
readonly property real leftMargin: (root.width / 2) - (taskSwitcherState.taskWidth / 2)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015 Marco Martin <notmart@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
||||
* SPDX-FileCopyrightText: 2021-2022 Devin Lin <devin@kde.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
|
@ -29,8 +29,8 @@ Item {
|
|||
}
|
||||
|
||||
// task list model
|
||||
property TaskManager.TasksModel model
|
||||
readonly property int tasksCount: model.count
|
||||
property TaskManager.TasksModel tasksModel
|
||||
readonly property int tasksCount: tasksModel.count
|
||||
|
||||
property var displaysModel: MobileShell.DisplaysModel {}
|
||||
|
||||
|
|
@ -65,12 +65,12 @@ Item {
|
|||
taskSwitcherState.cancelAnimations();
|
||||
taskSwitcherState.yPosition = 0;
|
||||
taskSwitcherState.xPosition = 0;
|
||||
taskSwitcherState.wasInActiveTask = root.model.activeTask.row >= 0;
|
||||
taskSwitcherState.wasInActiveTask = tasksModel.activeTask.row >= 0;
|
||||
taskSwitcherState.currentlyBeingOpened = true;
|
||||
|
||||
// skip to first active task
|
||||
if (taskSwitcherState.wasInActiveTask) {
|
||||
taskSwitcherState.goToTaskIndex(root.model.activeTask.row);
|
||||
taskSwitcherState.goToTaskIndex(tasksModel.activeTask.row);
|
||||
}
|
||||
|
||||
// show task switcher, hide all running apps
|
||||
|
|
@ -103,12 +103,12 @@ Item {
|
|||
return;
|
||||
}
|
||||
|
||||
var newActiveIdx = root.model.index(id, 0)
|
||||
var newActiveIdx = tasksModel.index(id, 0)
|
||||
var newActiveGeo = tasksModel.data(newActiveIdx, TaskManager.AbstractTasksModel.ScreenGeometry)
|
||||
for (var i = 0 ; i < tasksModel.count; i++) {
|
||||
var idx = root.model.index(i, 0)
|
||||
var idx = tasksModel.index(i, 0)
|
||||
if (i == id) {
|
||||
root.model.requestActivate(idx);
|
||||
tasksModel.requestActivate(idx);
|
||||
} else if (!tasksModel.data(idx, TaskManager.AbstractTasksModel.IsMinimized)) {
|
||||
var geo = tasksModel.data(idx, TaskManager.AbstractTasksModel.ScreenGeometry)
|
||||
// only minimize the other windows in the same screen
|
||||
|
|
|
|||
|
|
@ -168,16 +168,6 @@ FocusScope {
|
|||
}
|
||||
|
||||
// task switcher component
|
||||
TaskManager.TasksModel {
|
||||
id: tasksModel
|
||||
groupMode: TaskManager.TasksModel.GroupDisabled
|
||||
|
||||
screenGeometry: plasmoid.screenGeometry
|
||||
sortMode: TaskManager.TasksModel.SortAlpha
|
||||
|
||||
virtualDesktop: virtualDesktopInfo.currentDesktop
|
||||
activity: activityInfo.currentActivity
|
||||
}
|
||||
|
||||
TaskManager.VirtualDesktopInfo {
|
||||
id: virtualDesktopInfo
|
||||
|
|
@ -189,7 +179,16 @@ FocusScope {
|
|||
|
||||
MobileShell.TaskSwitcher {
|
||||
id: taskSwitcher
|
||||
model: tasksModel
|
||||
|
||||
tasksModel: TaskManager.TasksModel {
|
||||
groupMode: TaskManager.TasksModel.GroupDisabled
|
||||
|
||||
screenGeometry: plasmoid.screenGeometry
|
||||
sortMode: TaskManager.TasksModel.SortAlpha
|
||||
|
||||
virtualDesktop: virtualDesktopInfo.currentDesktop
|
||||
activity: activityInfo.currentActivity
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
|
|
@ -213,7 +212,7 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
// start app animation
|
||||
// start app animation component
|
||||
MobileShell.StartupFeedback {
|
||||
id: startupFeedback
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
Loading…
Reference in a new issue