Files
DankMaterialShell/quickshell/Modules/Settings/Widgets/SettingsToggleRow.qml
T
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

47 lines
1.1 KiB
QML

import QtQuick
import qs.Common
import qs.DCommon.Widgets
SettingsRow {
id: root
property string text: ""
property string description: ""
property color descriptionColor: Theme.surfaceVariantText
property bool checked: false
property bool toggling: false
signal toggled(bool checked)
title: text
subtitle: description
subtitleColor: descriptionColor
clickable: true
resetByKeys: false
onResetRequested: {
if (!resetByKeys)
toggled(!checked);
}
Accessible.role: Accessible.CheckBox
Accessible.checkable: true
Accessible.checked: checked
Accessible.onToggleAction: root.clicked(true)
onClicked: {
if (!enabled || toggling)
return;
toggled(!checked);
}
DToggle {
hideText: true
text: root.text
description: root.description
activeFocusOnTab: false
Accessible.ignored: true
checked: root.checked
enabled: root.enabled
toggling: root.toggling
onToggled: value => root.toggled(value)
}
}