Files
bbedward ccbf1d38ad widgets: bump qml-common, rename Dank* prefixed widgets to D, add
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
2026-10-05 16:47:19 -04:00

67 lines
2.2 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import qs.Common
import qs.DCommon.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
DMaterialShape {
anchors.centerIn: parent
width: Theme.iconSizeLarge
height: Theme.iconSizeLarge
shape: swatch.modelData === "round" ? "circle" : swatch.modelData
color: Theme.secondaryContainer
DIcon {
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)
}
}
}
}
}
}