mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-16 08:14:03 -04:00
deprecation notice to plugin compatibility shims - When qml-common became a thing, we left qs.Widgets shims in place for plugin compatibility - It's annoying to need to maintain them when qml-common has any change, add a warning so we can safely deprecate them in the future - One shot rename the common stuff to D to make it shorter and nicer to write
84 lines
2.9 KiB
QML
84 lines
2.9 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import qs.Common
|
|
import qs.Services
|
|
import qs.Modules.ControlCenter
|
|
import qs.Modules.ControlCenter.Widgets
|
|
import qs.DCommon.Widgets
|
|
|
|
Item {
|
|
id: root
|
|
|
|
implicitHeight: column.height
|
|
|
|
LayoutMirroring.enabled: I18n.isRtl
|
|
LayoutMirroring.childrenInherit: true
|
|
|
|
readonly property string title: I18n.tr("Running apps")
|
|
property var toplevels: []
|
|
readonly property int count: toplevels.length
|
|
|
|
signal closeRequested
|
|
signal dismissRequested
|
|
|
|
onCountChanged: {
|
|
if (count === 0)
|
|
dismissRequested();
|
|
}
|
|
|
|
DFlickable {
|
|
anchors.fill: parent
|
|
contentHeight: column.height
|
|
clip: true
|
|
|
|
Column {
|
|
id: column
|
|
width: parent.width
|
|
spacing: CcMetrics.detailContentGap
|
|
|
|
CcGroup {
|
|
Repeater {
|
|
model: ScriptModel {
|
|
values: root.toplevels
|
|
objectProp: CompositorService.toplevelKey
|
|
}
|
|
|
|
CcListRow {
|
|
id: row
|
|
|
|
required property var modelData
|
|
readonly property string appId: modelData?.appId ?? ""
|
|
readonly property string appName: Paths.getAppName(appId, DesktopEntries.heuristicLookup(appId))
|
|
readonly property var placement: CompositorService.toplevelPlacement(modelData)
|
|
readonly property string workspaceLabel: placement.workspace ? I18n.tr("Workspace %1", "control center running app row, %1 is a workspace number or name").arg(placement.workspace) : ""
|
|
readonly property string outputLabel: Quickshell.screens.length > 1 ? (SettingsData.getScreenDisplayName(Quickshell.screens.find(screen => screen.name === placement.output)) || placement.output) : ""
|
|
|
|
title: modelData?.title || appName
|
|
subtitle: [modelData?.title ? appName : "", workspaceLabel, outputLabel].filter(text => text !== "").join(" · ")
|
|
clickable: true
|
|
onClicked: {
|
|
modelData?.activate();
|
|
root.closeRequested();
|
|
}
|
|
|
|
leading: CcAppIcon {
|
|
appId: row.appId
|
|
iconSize: Theme.iconSizeLarge
|
|
}
|
|
|
|
DActionButton {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
iconName: "close"
|
|
iconColor: Theme.onSurfaceVariant
|
|
Accessible.name: I18n.tr("Close")
|
|
onClicked: row.modelData?.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|