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

80 lines
2.2 KiB
QML

import QtQuick
import qs.Common
import qs.DCommon.Widgets
Rectangle {
id: root
required property bool gridEnabled
required property int gridSize
width: helperRow.implicitWidth + Theme.spacingM * 2
height: Theme.buttonHeightXS
radius: Theme.cornerRadius
color: Theme.hostSurface
Row {
id: helperRow
anchors.centerIn: parent
spacing: Theme.spacingM
height: parent.height
Row {
spacing: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
DIcon {
name: "grid_on"
size: Theme.iconSizeSmall
color: root.gridEnabled ? Theme.primary : Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: root.gridEnabled ? I18n.tr("Grid: ON", "Widget grid snap status") : I18n.tr("Grid: OFF", "Widget grid snap status")
font.pixelSize: Theme.fontSizeSmall
font.family: Theme.fontFamily
color: root.gridEnabled ? Theme.primary : Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
DKeycap {
text: "G"
anchors.verticalCenter: parent.verticalCenter
}
}
Rectangle {
width: Theme.dividerWidth
height: Theme.iconSizeSmall
color: Theme.outline
anchors.verticalCenter: parent.verticalCenter
}
Row {
spacing: Theme.spacingS
anchors.verticalCenter: parent.verticalCenter
DKeycap {
text: "Z"
anchors.verticalCenter: parent.verticalCenter
}
NumericText {
text: root.gridSize + "px"
reserveText: "200px"
width: Math.ceil(reservedWidth)
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
DKeycap {
text: "X"
anchors.verticalCenter: parent.verticalCenter
}
}
}
}