diff --git a/plasmoid/contents/ui/CustomMicIndicator.qml b/plasmoid/contents/ui/CustomMicIndicator.qml new file mode 100644 --- /dev/null +++ b/plasmoid/contents/ui/CustomMicIndicator.qml @@ -0,0 +1,93 @@ +import QtQuick 2.9 +import org.kde.plasma.components 2.0 as PlasmaComponents + +Item { + anchors.fill: parent + + Rectangle { + id: innerCircleSurround + anchors.centerIn: parent + color: "#404682b4" + border.color: "#00000000" + border.width: units.gridUnit * 0.2 + radius: 100 + implicitWidth: units.gridUnit * 2.7 + implicitHeight: units.gridUnit * 2.7 + } + + Rectangle { + id: innerCircleSurroundOutterRing + anchors.centerIn: parent + color: "#00000000" + border.color: "lightblue" + border.width: units.gridUnit * 0.2 + radius: 100 + implicitWidth: units.gridUnit * 2.7 + implicitHeight: units.gridUnit * 2.7 + } + + Rectangle { + id: innerCircleIn + anchors.centerIn: parent + color: "lightblue" + border.color: "steelblue" + border.width: units.gridUnit * 0.1 + radius: 100 + implicitWidth: units.gridUnit * 1.7 + implicitHeight: units.gridUnit * 1.7 + } + + Rectangle { + id: innerCircleInMic + anchors.centerIn: parent + color: "#00000000" + border.color: "#00000000" + border.width: units.gridUnit * 0.1 + radius: 100 + implicitWidth: units.gridUnit * 1.7 + implicitHeight: units.gridUnit * 1.7 + + PlasmaComponents.ToolButton { + id: innerImgInnerCirc + anchors.centerIn: parent + iconSource: "audio-input-microphone" + width: units.gridUnit * 2 + height: units.gridUnit * 2 + + onClicked: { + var socketmessage = {}; + socketmessage.type = "mycroft.mic.listen"; + socketmessage.data = {}; + socketmessage.data.utterances = []; + socket.sendTextMessage(JSON.stringify(socketmessage)); + } + } + } + + ScaleAnimator { + target: innerCircleSurround + running: true + from: 1.2 + to: 0.8 + duration: 3600 + loops: Animation.Infinite + } + + ScaleAnimator { + target: innerCircleSurroundOutterRing + running: true + from: 1 + to: 0.9 + duration: 3600 + loops: Animation.Infinite + } + + ScaleAnimator { + target: innerCircleIn + running: true + from: 0.8 + to: 1 + duration: 3600 + loops: Animation.Infinite + } +} diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -85,6 +85,23 @@ } } + function toggleInputMethod(selection){ + switch(selection){ + case "KeyboardSetActive": + qinput.visible = true + suggestionbottombox.visible = true + customMicIndicator.visible = false + keybindic.color = "green" + break + case "KeyboardSetDisable": + qinput.visible = false + suggestionbottombox.visible = false + customMicIndicator.visible = true + keybindic.color = theme.textColor + break + } + } + function retryConn(){ socket.active = true if (socket.active = false){ @@ -1152,7 +1169,7 @@ PlasmaComponents.TextField { id: qinput - anchors.left: parent.left + anchors.left: keyboardactivaterect.right anchors.bottom: parent.bottom anchors.right: parent.right placeholderText: i18n("Enter Query or Say 'Hey Mycroft'") @@ -1179,6 +1196,12 @@ } } + CustomMicIndicator { + id: customMicIndicator + anchors.centerIn: parent + visible: false + } + AutocompleteBox { id: suggestionsBox model: completionItems