mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-21 18:54: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
69 lines
2.1 KiB
QML
69 lines
2.1 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import qs.Common
|
|
import qs.Services
|
|
import qs.DCommon.Widgets
|
|
import qs.Modules.Settings.Widgets
|
|
|
|
SettingsReorderRow {
|
|
id: root
|
|
|
|
required property var instanceData
|
|
|
|
readonly property string instanceId: instanceData?.id ?? ""
|
|
readonly property string widgetType: instanceData?.widgetType ?? ""
|
|
readonly property var widgetDef: DesktopWidgetRegistry.getWidget(widgetType)
|
|
readonly property string widgetName: instanceData?.name || widgetDef?.name || widgetType
|
|
property bool fixed: false
|
|
|
|
signal configureRequested
|
|
signal deleteRequested
|
|
signal duplicateRequested
|
|
|
|
iconName: widgetDef?.icon ?? "widgets"
|
|
title: widgetName
|
|
subtitle: deleteButton.confirming ? I18n.tr("Confirm Delete") : ""
|
|
subtitleColor: Theme.error
|
|
clickable: true
|
|
onClicked: configureRequested()
|
|
|
|
trailing: [
|
|
DIcon {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
name: "chevron_right"
|
|
size: Theme.iconSize
|
|
color: Theme.onSurfaceVariant
|
|
rotation: I18n.isRtl ? 180 : 0
|
|
},
|
|
SettingsDivider {
|
|
vertical: true
|
|
},
|
|
DToggle {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
visible: !root.fixed
|
|
hideText: true
|
|
text: root.title
|
|
checked: root.instanceData?.enabled ?? true
|
|
onToggled: isChecked => {
|
|
SettingsData.updateDesktopWidgetInstance(root.instanceId, {
|
|
enabled: isChecked
|
|
});
|
|
}
|
|
},
|
|
DActionButton {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
visible: !root.fixed
|
|
iconName: "content_copy"
|
|
tooltipText: I18n.tr("Duplicate", "verb, desktop widget menu action")
|
|
onClicked: root.duplicateRequested()
|
|
},
|
|
SettingsDeleteButton {
|
|
id: deleteButton
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
visible: !root.fixed
|
|
onDeleteRequested: root.deleteRequested()
|
|
}
|
|
]
|
|
}
|