mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-14 23:34:01 -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
48 lines
1.4 KiB
QML
48 lines
1.4 KiB
QML
import QtQuick
|
|
import qs.Common
|
|
import qs.DCommon.Widgets
|
|
import qs.DCommon.Session
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property var instanceData: null
|
|
property var lockHost: null
|
|
readonly property var cfg: instanceData?.config ?? ({})
|
|
readonly property string shape: cfg.shape ?? "round"
|
|
readonly property bool round: shape === "round"
|
|
readonly property bool resizable: false
|
|
readonly property real minWidth: implicitWidth
|
|
readonly property real minHeight: implicitHeight
|
|
|
|
implicitWidth: powerButton.width
|
|
implicitHeight: powerButton.height
|
|
|
|
DMaterialShape {
|
|
anchors.fill: powerButton
|
|
visible: !root.round
|
|
shape: root.shape
|
|
color: Theme.secondaryContainer
|
|
scale: powerButton.pressed ? 0.9 : 1
|
|
|
|
Behavior on scale {
|
|
NumberAnimation {
|
|
duration: LockMetrics.shakeDuration
|
|
easing.type: Easing.BezierSpline
|
|
easing.bezierCurve: Theme.expressiveCurves.expressiveFastSpatial
|
|
}
|
|
}
|
|
}
|
|
|
|
LockActionButton {
|
|
id: powerButton
|
|
Accessible.name: I18n.tr("Power Options")
|
|
iconName: "power_settings_new"
|
|
iconColor: Theme.onSecondaryContainer
|
|
backgroundColor: root.round ? Theme.secondaryContainer : "transparent"
|
|
radius: pressed ? Theme.cornerRadiusS : Theme.fullRadius(width, height)
|
|
buttonSize: Theme.buttonHeightM
|
|
onClicked: root.lockHost?.showPowerMenu()
|
|
}
|
|
}
|