2023-03-19 01:54:41 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
2023-03-19 01:48:49 +00:00
|
|
|
import QtQuick
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.core as PlasmaCore
|
|
|
|
|
import org.kde.taskmanager as TaskManager
|
2023-04-01 05:20:56 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
2023-08-29 14:30:12 +00:00
|
|
|
import org.kde.kitemmodels as KItemModels
|
2023-03-19 01:48:49 +00:00
|
|
|
|
|
|
|
|
// Helper component that uses Plasma's tasks model to provide whether a maximized window is showing on the current screen.
|
|
|
|
|
QtObject {
|
2024-06-23 22:47:24 +00:00
|
|
|
// Setting this property is necessary to filter by screen, otherwise the model will use all screens.
|
|
|
|
|
// Set it to Plasmoid.containment.screenGeometry in a plasmoid to accomplish this.
|
|
|
|
|
property alias screenGeometry: tasksModel.screenGeometry
|
|
|
|
|
|
2023-04-01 05:20:56 +00:00
|
|
|
readonly property bool showingWindow: __internal.count > 0 && !WindowPlugin.WindowUtil.isShowingDesktop
|
2023-03-19 01:48:49 +00:00
|
|
|
|
2023-08-29 14:30:12 +00:00
|
|
|
property var __internal: KItemModels.KSortFilterProxyModel {
|
2023-03-19 01:48:49 +00:00
|
|
|
id: visibleMaximizedWindowsModel
|
2023-08-29 14:30:12 +00:00
|
|
|
filterRoleName: 'IsMinimized'
|
|
|
|
|
filterString: 'false'
|
2023-03-19 01:48:49 +00:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property var vdi: TaskManager.VirtualDesktopInfo {
|
|
|
|
|
id: virtualDesktopInfo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property var ai: TaskManager.ActivityInfo {
|
|
|
|
|
id: activityInfo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|