8import org.kde.kirigami as Kirigami
13 height: Kirigami.Units.gridUnit
17 property bool selectionStartHandle: false
19 visible: Kirigami.Settings.tabletMode && ((target.activeFocus && !selectionStartHandle) || target.selectedText.length > 0)
24 horizontalCenter: parent.horizontalCenter
28 color: Qt.tint(Kirigami.Theme.highlightColor, Qt.rgba(1,1,1,0.4))
31 width: Math.round(Kirigami.Units.gridUnit / 1.5)
33 visible: MobileTextActionsToolBar.shouldBeVisible
35 horizontalCenter: parent.horizontalCenter
36 verticalCenter: parent.bottom
39 color: Qt.tint(Kirigami.Theme.highlightColor, Qt.rgba(1,1,1,0.4))
44 margins: -Kirigami.Units.gridUnit
47 onPositionChanged: mouse => {
48 var pos = mapToItem(target, mouse.x, mouse.y);
49 pos = target.positionAt(pos.x, pos.y);
51 if (target.selectedText.length > 0) {
52 if (selectionStartHandle) {
53 target.select(Math.min(pos, target.selectionEnd - 1), target.selectionEnd);
55 target.select(target.selectionStart, Math.max(pos, target.selectionStart + 1));
58 target.cursorPosition = pos;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:24 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.