import QtQuick // The dismiss key left floating while the keyboard is shrunk; see-through so // it hides less. Tap to bring the keyboard back; dragging is up to the owner // (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 // The move ends with a release that would otherwise count 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(); } } }