Files
DankMaterialShell/quickshell/Modules/ControlCenter/Widgets/UserCardTile.qml
T
purian23 64b4d0d235 feat(control center): configurable user card & power control action tiles
- Quick actions are reorderable with button color roles and optional power accents
- Updated dank-qml-common
2026-09-27 20:55:54 -04:00

38 lines
1.2 KiB
QML

import QtQuick
import qs.Common
import qs.Services
import qs.Widgets
import qs.Modules.ControlCenter
import qs.Modules.DankDash
CcCardTile {
id: root
// Keys and defaults come from the dashboard user card so both surfaces expose the same toggles.
readonly property var options: DashRegistry.resolvedOptions("user", widgetData)
readonly property bool tapToClose: interactive && (host?.tapToClose ?? false)
Accessible.role: tapToClose ? Accessible.Button : Accessible.Pane
Accessible.name: UserInfoService.username
UserIdentity {
anchors.fill: parent
anchors.margins: root.pad
anchors.leftMargin: root.narrow ? root.pad : root.pad + Theme.spacingXS
live: root.live
options: root.options
narrow: root.width < CcMetrics.columnWidth * 2
tall: root.tall
avatarSize: root.tall ? DashMetrics.avatarSizeHero : DashMetrics.avatarSize
contentColor: CcMetrics.tileInactiveContent
mutedColor: CcMetrics.tileInactiveSubtitle
}
MouseArea {
anchors.fill: parent
enabled: root.tapToClose
acceptedButtons: Qt.LeftButton
onClicked: root.host?.headerTapped()
}
}