Fix Phone controls runtime accessibility
This commit is contained in:
@@ -138,8 +138,20 @@ Item {
|
||||
color: actionMouse.containsMouse && actionMouse.enabled
|
||||
? Theme.alpha(Theme.accent, 0.15)
|
||||
: Theme.alpha(Theme.accent, 0.075)
|
||||
border.width: actionMouse.activeFocus ? 2 : 0
|
||||
border.color: Theme.accent
|
||||
opacity: actionMouse.enabled ? 1 : 0.48
|
||||
|
||||
Accessible.role: Accessible.Button
|
||||
Accessible.name: actionButton.modelData.label
|
||||
Accessible.description: root.actionAccessibleDescription(actionButton.modelData.id)
|
||||
Accessible.focusable: actionMouse.enabled
|
||||
Accessible.focused: actionMouse.activeFocus
|
||||
Accessible.onPressAction: {
|
||||
if (actionMouse.enabled)
|
||||
root.invoke(actionButton.modelData.id);
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
@@ -162,11 +174,7 @@ Item {
|
||||
MouseArea {
|
||||
id: actionMouse
|
||||
anchors.fill: parent
|
||||
enabled: actionButton.modelData.id === "messages"
|
||||
? SystemSettings.bluebubblesAvailable
|
||||
: KdeConnect.phoneReachable
|
||||
&& !KdeConnect.transferActive
|
||||
&& KdeConnect.supports(actionButton.modelData.id)
|
||||
enabled: root.actionEnabled(actionButton.modelData.id)
|
||||
hoverEnabled: true
|
||||
activeFocusOnTab: enabled
|
||||
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
@@ -181,7 +189,7 @@ Item {
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: root.phone && !KdeConnect.phoneReachable && root.actionModels.length > 0
|
||||
text: "Actions become available when the iPhone reconnects"
|
||||
text: "KDE Connect actions are unavailable until the iPhone reconnects"
|
||||
color: Theme.fgMuted
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: Theme.fontFamily
|
||||
@@ -279,6 +287,20 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function actionEnabled(action: string): bool {
|
||||
if (action === "messages")
|
||||
return SystemSettings.bluebubblesAvailable;
|
||||
return KdeConnect.phoneReachable
|
||||
&& !KdeConnect.transferActive
|
||||
&& KdeConnect.supports(action);
|
||||
}
|
||||
|
||||
function actionAccessibleDescription(action: string): string {
|
||||
if (action === "messages")
|
||||
return SystemSettings.bluebubblesAvailable ? "Opens BlueBubbles" : "BlueBubbles is not installed";
|
||||
return root.actionEnabled(action) ? "Available through KDE Connect" : "Unavailable through KDE Connect";
|
||||
}
|
||||
|
||||
function localPath(selectedUrl: url): string {
|
||||
const value = String(selectedUrl);
|
||||
if (!value.startsWith("file://"))
|
||||
|
||||
Reference in New Issue
Block a user