Add Accessibility properties
Also clean up increase and decrease actions for Slider a tiny bit.
This commit is contained in:
parent
596dc7523d
commit
2f93b7f764
@ -278,4 +278,13 @@ Item {
|
||||
onTriggered: Tooltip.showText(mouse, Qt.point(mouse.mouseX, mouse.mouseY), tooltip)
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: text
|
||||
Accessible.description: tooltip
|
||||
Accessible.checkable: checkable
|
||||
Accessible.checked: checked
|
||||
function accessiblePressAction() {
|
||||
internal.clickButton()
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ PlasmaComponents.Dialog {
|
||||
*/
|
||||
signal buttonClicked(int index)
|
||||
|
||||
Accessible.role: Accessible.Dialog
|
||||
|
||||
onButtonTextsChanged: {
|
||||
print("btex6tchanged:" + buttonTexts);
|
||||
for (var i = buttonRow.children.length; i > 0; --i) {
|
||||
|
@ -51,4 +51,7 @@ Text {
|
||||
color: theme.textColor
|
||||
|
||||
opacity: enabled? 1 : 0.6
|
||||
|
||||
Accessible.role: Accessible.StaticText
|
||||
Accessible.name: text
|
||||
}
|
||||
|
@ -137,4 +137,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.ListItem
|
||||
}
|
||||
|
@ -80,4 +80,5 @@ PlasmaComponents.ContextMenu {
|
||||
}
|
||||
}
|
||||
}
|
||||
Accessible.role: Accessible.PopupMenu
|
||||
}
|
||||
|
@ -136,4 +136,6 @@ Item {
|
||||
to: background._isVertical ? background.height - bar.height : background.width - bar.width
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.ProgressBar
|
||||
}
|
||||
|
@ -63,4 +63,5 @@ Private.DualStateButton {
|
||||
activeFocusOnTab: true
|
||||
|
||||
shadow: Private.RoundShadow {}
|
||||
Accessible.role: Accessible.RadioButton
|
||||
}
|
||||
|
@ -215,4 +215,5 @@ Item {
|
||||
|
||||
source: interactive ? "private/ScrollBarDelegate.qml" : "private/ScrollDecoratorDelegate.qml"
|
||||
}
|
||||
Accessible.role: Accessible.ScrollBar
|
||||
}
|
||||
|
@ -179,4 +179,5 @@ Item {
|
||||
listView.model.itemsRemoved.connect(dirtyObserver);
|
||||
}
|
||||
}
|
||||
Accessible.role: Accessible.ScrollBar
|
||||
}
|
||||
|
@ -112,43 +112,24 @@ Item {
|
||||
|
||||
activeFocusOnTab: true
|
||||
|
||||
Keys.onUpPressed: {
|
||||
if (!enabled || !contents.isVertical)
|
||||
Keys.onUpPressed: { if (contents.isVertical) decrease() }
|
||||
Keys.onDownPressed: { if (contents.isVertical) increase() }
|
||||
Keys.onLeftPressed: { if (!contents.isVertical) increase() }
|
||||
Keys.onRightPressed: { if (!contents.isVertical) decrease() }
|
||||
function accessibleIncreaseAction() { increase() }
|
||||
function accessibleDecreaseAction() { decrease() }
|
||||
|
||||
function increase() {
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (inverted)
|
||||
value -= stepSize;
|
||||
else
|
||||
value += stepSize;
|
||||
}
|
||||
|
||||
Keys.onDownPressed: {
|
||||
if (!enabled || !enabled)
|
||||
return;
|
||||
|
||||
if (!contents.isVertical)
|
||||
return;
|
||||
|
||||
if (inverted)
|
||||
value += stepSize;
|
||||
else
|
||||
value -= stepSize;
|
||||
}
|
||||
|
||||
Keys.onLeftPressed: {
|
||||
if (!enabled || contents.isVertical)
|
||||
function decrease() {
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
if (inverted)
|
||||
value += stepSize;
|
||||
else
|
||||
value -= stepSize;
|
||||
}
|
||||
|
||||
Keys.onRightPressed: {
|
||||
if (!enabled || contents.isVertical)
|
||||
return;
|
||||
|
||||
if (inverted)
|
||||
value -= stepSize;
|
||||
else
|
||||
@ -327,4 +308,5 @@ Item {
|
||||
property: "x"
|
||||
value: range.position
|
||||
}
|
||||
Accessible.role: Accessible.Slider
|
||||
}
|
||||
|
@ -63,4 +63,5 @@ Private.DualStateButton {
|
||||
}
|
||||
|
||||
shadow: Private.ButtonShadow {}
|
||||
Accessible.role: Accessible.CheckBox
|
||||
}
|
||||
|
@ -82,6 +82,8 @@ FocusScope {
|
||||
implicitWidth: layout.implicitWidth
|
||||
implicitHeight: layout.implicitHeight
|
||||
|
||||
Accessible.role: Accessible.PageTabList
|
||||
|
||||
Item {
|
||||
id: buttonCutter
|
||||
anchors {
|
||||
|
@ -87,6 +87,11 @@ Item {
|
||||
*/
|
||||
signal clicked
|
||||
|
||||
Accessible.role: Accessible.PageTab
|
||||
Accessible.checkable: true
|
||||
Accessible.checked: checked
|
||||
Accessible.name: text
|
||||
|
||||
implicitWidth: Math.max(label.implicitWidth + (internal.portrait ? 0 : (iconSource != null ? units.iconSizes.small : 0)), height)
|
||||
implicitHeight: 20//label.implicitHeight + (internal.portrait ? (iconSource != null ? units.iconSizes.small : 0) : 0)
|
||||
|
||||
|
@ -437,4 +437,7 @@ Item {
|
||||
orientation: Qt.Vertical
|
||||
stepSize: textEdit.font.pixelSize
|
||||
}
|
||||
|
||||
Accessible.role: EditableText
|
||||
Accessible.readOnly: readOnly
|
||||
}
|
||||
|
@ -384,4 +384,10 @@ FocusScope {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.name: text
|
||||
Accessible.role: EditableText
|
||||
Accessible.readOnly: readOnly
|
||||
Accessible.passwordEdit: echoMode == TextInput.Password || echoMode === TextInput.PasswordEchoOnEdit
|
||||
Accessible.description: placeholderText
|
||||
}
|
||||
|
@ -239,4 +239,6 @@ Item{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.ToolBar
|
||||
}
|
||||
|
@ -434,5 +434,12 @@ Item {
|
||||
onTriggered: Tooltip.showText(mouse, Qt.point(mouse.mouseX, mouse.mouseY), tooltip)
|
||||
}
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: text
|
||||
Accessible.description: tooltip
|
||||
function accessiblePressAction() {
|
||||
internal.clickButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,14 @@ Item {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onReleased: dualButton.released();
|
||||
onPressed: dualButton.forceActiveFocus();
|
||||
onReleased: dualButton.released();
|
||||
}
|
||||
Accessible.name: text
|
||||
Accessible.checkable: checkable
|
||||
Accessible.checked: checked
|
||||
function accessiblePressAction() {
|
||||
dualButton.forceActiveFocus()
|
||||
dualButton.released()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user