camper/src/MnemonicLabel.qml
jordi fita mas 9f181047ac Bind MnemonicLabel’s “plain” label to buddy’s Accessible.name
This is to give a default name to form controls by default, like <label>
does to <input> and <textarea> in HTML.

Had to add a “plain” version of the label, with neither the <u> tag used
in rich text or the ‘&’ in the “regular” label, otherwise orca would
spell out these symbols.
2024-12-30 09:50:36 +01:00

28 lines
529 B
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
Label {
id: control
required property Item buddy
required property string mnemonic
Mnemonic.label: control.mnemonic
text: Mnemonic.richTextLabel
Shortcut {
sequence: control.Mnemonic.sequence
onActivated: function () {
control.buddy.forceActiveFocus();
}
}
Binding {
property: "Accessible.name"
target: control.buddy
value: control.Mnemonic.plainLabel
}
}