Add BlueBubbles to Phone controls
This commit is contained in:
@@ -10,11 +10,14 @@ Item {
|
||||
signal toggleExpanded
|
||||
|
||||
readonly property var phone: KdeConnect.preferredPhone
|
||||
// Keep the four slots stable. The KDE actions can become unavailable when
|
||||
// the phone disconnects, but the layout should not shift beneath Messages.
|
||||
readonly property var actionModels: [
|
||||
{ id: "share", glyph: "\u{F0142}", label: "Send file" },
|
||||
{ id: "clipboard", glyph: "\u{F014C}", label: "Clipboard" },
|
||||
{ id: "ring", glyph: "\u{F009A}", label: "Ring" }
|
||||
].filter(item => KdeConnect.supports(item.id))
|
||||
{ id: "ring", glyph: "\u{F009A}", label: "Ring" },
|
||||
{ id: "messages", glyph: "\u{F0365}", label: "Messages" }
|
||||
]
|
||||
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
@@ -120,9 +123,8 @@ Item {
|
||||
Grid {
|
||||
id: actionsGrid
|
||||
width: parent.width
|
||||
columns: Math.max(1, root.actionModels.length)
|
||||
columns: 4
|
||||
spacing: 7
|
||||
visible: root.actionModels.length > 0
|
||||
|
||||
Repeater {
|
||||
model: root.actionModels
|
||||
@@ -160,10 +162,17 @@ Item {
|
||||
MouseArea {
|
||||
id: actionMouse
|
||||
anchors.fill: parent
|
||||
enabled: KdeConnect.phoneReachable && !KdeConnect.transferActive
|
||||
enabled: actionButton.modelData.id === "messages"
|
||||
? SystemSettings.bluebubblesAvailable
|
||||
: KdeConnect.phoneReachable
|
||||
&& !KdeConnect.transferActive
|
||||
&& KdeConnect.supports(actionButton.modelData.id)
|
||||
hoverEnabled: true
|
||||
activeFocusOnTab: enabled
|
||||
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
onClicked: root.invoke(actionButton.modelData.id)
|
||||
Keys.onReturnPressed: root.invoke(actionButton.modelData.id)
|
||||
Keys.onSpacePressed: root.invoke(actionButton.modelData.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,6 +188,16 @@ Item {
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: !SystemSettings.bluebubblesAvailable
|
||||
text: "BlueBubbles is not installed"
|
||||
color: Theme.fgMuted
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
visible: KdeConnect.lastError !== ""
|
||||
@@ -254,6 +273,10 @@ Item {
|
||||
KdeConnect.sendClipboard();
|
||||
else if (action === "ring")
|
||||
KdeConnect.ring();
|
||||
else if (action === "messages") {
|
||||
if (SystemSettings.bluebubblesAvailable && SystemSettings.openApplication("bluebubbles"))
|
||||
ShellState.close();
|
||||
}
|
||||
}
|
||||
|
||||
function localPath(selectedUrl: url): string {
|
||||
|
||||
Reference in New Issue
Block a user