Files
DankMaterialShell/quickshell/Modules/Settings/LockWidgetSettings/LockPowerSettings.qml
T

67 lines
2.2 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import qs.Common
import qs.Widgets
import qs.Modules.Settings.Widgets
import qs.Modules.Settings.DesktopWidgetSettings
DesktopWidgetInstanceSettings {
id: root
readonly property var shapes: ["round", "cookie9", "clover4", "sunny", "softBurst"]
readonly property string shape: cfg.shape ?? "round"
showAppearance: false
SettingsRow {
title: I18n.tr("Style")
body: Row {
width: parent.width
spacing: Theme.spacingS
Repeater {
model: root.shapes
Rectangle {
id: swatch
required property string modelData
readonly property bool selected: root.shape === modelData
width: (parent.width - Theme.spacingS * (root.shapes.length - 1)) / root.shapes.length
height: Theme.listItemHeight + Theme.spacingXS
radius: Theme.cornerRadius
color: selected ? Theme.primarySelected : SettingsMetrics.controlColor
border.color: selected ? Theme.primary : Theme.withAlpha(Theme.primary, 0)
border.width: Theme.outlineWidthFocused
Accessible.role: Accessible.RadioButton
Accessible.name: modelData
DankMaterialShape {
anchors.centerIn: parent
width: Theme.iconSizeLarge
height: Theme.iconSizeLarge
shape: swatch.modelData === "round" ? "circle" : swatch.modelData
color: Theme.secondaryContainer
DankIcon {
anchors.centerIn: parent
name: "power_settings_new"
size: Theme.iconSizeSmall
color: Theme.onSecondaryContainer
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.updateConfig("shape", swatch.modelData)
}
}
}
}
}
}