import QtQuick // Button shown in place of the keyboard while it is collapsed. Semi-transparent // so it covers less. Tap emits tapped() (expand); drag emits dragStarted() and // the parent starts the window manager's move. Item { id: button signal tapped() signal dragStarted() opacity: 0.6 Accessible.role: Accessible.Button Accessible.name: qsTr("Show Keyboard") Rectangle { anchors.fill: parent radius: Theme.keyRadius color: tap.pressed ? Theme.characterKey : Theme.functionKey } Text { anchors.centerIn: parent text: "⌨" font.pixelSize: button.height * 0.4 color: Theme.text } TapHandler { id: tap // Set during a drag, so the release that ends the drag isn't treated as a tap. property bool moved: false onPressedChanged: if (pressed) moved = false onTapped: if (!moved) button.tapped() } DragHandler { target: null onActiveChanged: { if (!active) return; tap.moved = true; button.dragStarted(); } } }