diff --git a/src/declarativeimports/CMakeLists.txt b/src/declarativeimports/CMakeLists.txt index 3fa13941c..7886ca669 100644 --- a/src/declarativeimports/CMakeLists.txt +++ b/src/declarativeimports/CMakeLists.txt @@ -1,73 +1,75 @@ add_subdirectory(accessdenied) add_subdirectory(core) add_subdirectory(plasmacomponents) add_subdirectory(plasmaextracomponents) add_subdirectory(platformcomponents) add_subdirectory(calendar) install(DIRECTORY plasmastyle/ DESTINATION ${KDE_INSTALL_QMLDIR}/QtQuick/Controls/Styles/Plasma) install(DIRECTORY kirigamiplasmastyle/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2/styles/Plasma) install(DIRECTORY kirigamiplasmadesktopstyle/ DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/kirigami.2/styles/org.kde.desktop.plasma) math(EXPR QQC2_VERSION "${Qt5QuickControls2_VERSION_MINOR} - 7") set(QQC2_VERSION "2.${QQC2_VERSION}") # Find all the source qml files FILE(GLOB_RECURSE inFiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/plasmacomponents3/*") #for each file, replace @QQC2_VERSION@ with the version we found FOREACH(infileName ${inFiles}) configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/${infileName}" "${CMAKE_CURRENT_BINARY_DIR}/${infileName}" INSTALL_DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Plasma" PATH_VARS QQC2_VERSION ) ENDFOREACH(infileName) #install the components as a QQC2 Style, as style for applications (mainly for Plasma Mobile) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ DESTINATION ${KDE_INSTALL_QMLDIR}/QtQuick/Controls.2/Plasma) #install some of the componets as a separate import, to be used in plasmoids (some of them like ApplicationWindow are of no use for plasmoids) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/BusyIndicator.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Button.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/CheckBox.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/CheckDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/CheckIndicator.qml #combobox is not in a new window, but maybe better already than the broken qqc1 combobox? ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ComboBox.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Container.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Control.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Dial.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Frame.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/GroupBox.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ItemDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Label.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ProgressBar.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/RadioButton.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/RadioDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/RadioIndicator.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/RangeSlider.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ScrollBar.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Slider.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/SpinBox.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/Switch.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/SwitchDelegate.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/SwitchIndicator.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/TabBar.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/TabButton.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/TextArea.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/TextField.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ToolBar.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/ToolButton.qml ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/components.3) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/private DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/components.3) +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/plasmacomponents3/mobiletextselection DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/components.3) + diff --git a/src/declarativeimports/plasmacomponents3/ComboBox.qml b/src/declarativeimports/plasmacomponents3/ComboBox.qml index 082f67008..fdd0fce0c 100644 --- a/src/declarativeimports/plasmacomponents3/ComboBox.qml +++ b/src/declarativeimports/plasmacomponents3/ComboBox.qml @@ -1,283 +1,284 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Templates @QQC2_VERSION@ as T import QtQuick.Controls @QQC2_VERSION@ as Controls import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami import "private" as Private +import "mobiletextselection" as MobileTextSelection T.ComboBox { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) + indicator.implicitWidth + rightPadding implicitHeight: units.gridUnit * 1.6 baselineOffset: contentItem.y + contentItem.baselineOffset hoverEnabled: true topPadding: surfaceNormal.margins.top leftPadding: surfaceNormal.margins.left rightPadding: surfaceNormal.margins.right + units.gridUnit * 2 bottomPadding: surfaceNormal.margins.bottom delegate: ItemDelegate { width: control.popup.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData highlighted: mouseArea.pressed ? listView.currentIndex == index : control.highlightedIndex == index property bool separatorVisible: false } indicator: PlasmaCore.SvgItem { implicitWidth: units.iconSizes.small implicitHeight: implicitWidth anchors { right: parent.right rightMargin: surfaceNormal.margins.right verticalCenter: parent.verticalCenter } svg: PlasmaCore.Svg { imagePath: "widgets/arrows" colorGroup: PlasmaCore.Theme.ButtonColorGroup } elementId: "down-arrow" } // contentItem: Label { // text: control.displayText // font: control.font // color: theme.buttonTextColor // horizontalAlignment: Text.AlignLeft // verticalAlignment: Text.AlignVCenter // elide: Text.ElideRight // } contentItem: MouseArea { id: mouseArea anchors.fill: parent acceptedButtons: Qt.LeftButton preventStealing: true property int indexUnderMouse: -1 onWheel: { if (wheel.pixelDelta.y < 0 || wheel.angleDelta.y < 0) { control.currentIndex = Math.min(control.currentIndex + 1, delegateModel.count -1); } else { control.currentIndex = Math.max(control.currentIndex - 1, 0); } control.activated(control.currentIndex); } onPressed: { indexUnderMouse = -1; listView.currentIndex = control.highlightedIndex control.down = true; control.pressed = true; control.popup.visible = !control.popup.visible; } onReleased: { if (!containsMouse) { control.down = false; control.pressed = false; control.popup.visible = false; } if (indexUnderMouse > -1) { control.currentIndex = indexUnderMouse; } } onCanceled: { control.down = false; control.pressed = false; } onPositionChanged: { var pos = listView.mapFromItem(this, mouse.x, mouse.y); indexUnderMouse = listView.indexAt(pos.x, pos.y); listView.currentIndex = indexUnderMouse; controlRoot.activated(indexUnderMouse); } Connections { target: popup onClosed: { control.down = false; control.pressed = false; } } T.TextField { id: textField padding: 0 anchors { fill:parent leftMargin: control.leftPadding rightMargin: control.rightPadding topMargin: control.topPadding bottomMargin: control.bottomPadding } text: control.editable ? control.editText : control.displayText enabled: control.editable autoScroll: control.editable readOnly: control.down || !control.hasOwnProperty("editable") || !control.editable inputMethodHints: control.inputMethodHints validator: control.validator // Work around Qt bug where NativeRendering breaks for non-integer scale factors // https://bugreports.qt.io/browse/QTBUG-67007 renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering color: PlasmaCore.ColorScope.textColor selectionColor: Kirigami.Theme.highlightColor selectedTextColor: Kirigami.Theme.highlightedTextColor selectByMouse: !Kirigami.Settings.tabletMode cursorDelegate: Kirigami.Settings.tabletMode ? mobileCursor : undefined font: control.font horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter opacity: control.enabled ? 1 : 0.3 onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = textField; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = textField; } } onPressAndHold: { if (!Kirigami.Settings.tabletMode) { return; } forceActiveFocus(); cursorPosition = positionAt(event.x, event.y); selectWord(); } } } Component { id: mobileCursor Private.MobileCursor { target: textField } } - Private.MobileCursor { + MobileTextSelection.MobileCursor { target: textField selectionStartHandle: true property var rect: textField.positionToRectangle(textField.selectionStart) //FIXME: this magic values seem to be always valid, for every font,every dpi, every scaling x: rect.x + 5 y: rect.y + 6 } background: PlasmaCore.FrameSvgItem { id: surfaceNormal //retrocompatibility with old controls implicitWidth: units.gridUnit * 6 anchors.fill: parent readonly property bool editable: control.hasOwnProperty("editable") && control.editable imagePath: editable ? "widgets/lineedit" : "widgets/button" prefix: editable ? "base" : (control.pressed ? "pressed" : "normal") Private.TextFieldFocus { visible: parent.editable z: -1 state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "hidden") anchors.fill: parent } Private.ButtonShadow { z: -1 visible: !parent.editable anchors.fill: parent state: { if (control.pressed) { return "hidden" } else if (control.hovered) { return "hover" } else if (control.activeFocus) { return "focus" } else { return "shadow" } } } MouseArea { anchors { fill: parent leftMargin: control.leftPadding rightMargin: control.rightPadding } acceptedButtons: Qt.NoButton onWheel: { if (wheel.pixelDelta.y < 0 || wheel.angleDelta.y < 0) { control.currentIndex = Math.min(control.currentIndex + 1, delegateModel.count -1); } else { control.currentIndex = Math.max(control.currentIndex - 1, 0); } control.activated(control.currentIndex); } } } popup: T.Popup { x: control.mirrored ? control.width - width : 0 y: control.height width: Math.max(control.width, 150) implicitHeight: contentItem.implicitHeight topMargin: 6 bottomMargin: 6 contentItem: ListView { id: listView clip: true implicitHeight: contentHeight model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex highlightRangeMode: ListView.ApplyRange highlightMoveDuration: 0 // HACK: When the ComboBox is not inside a top-level Window, it's Popup does not inherit // the LayoutMirroring options. This is a workaround to fix this by enforcing // the LayoutMirroring options properly. // QTBUG: https://bugreports.qt.io/browse/QTBUG-66446 LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft LayoutMirroring.childrenInherit: true T.ScrollBar.vertical: Controls.ScrollBar { } } background: Rectangle { anchors { fill: parent margins: -1 } radius: 2 color: theme.viewBackgroundColor border.color: Qt.rgba(theme.textColor.r, theme.textColor.g, theme.textColor.b, 0.3) layer.enabled: true layer.effect: DropShadow { transparentBorder: true radius: 4 samples: 8 horizontalOffset: 2 verticalOffset: 2 color: Qt.rgba(0, 0, 0, 0.3) } } } } diff --git a/src/declarativeimports/plasmacomponents3/TextArea.qml b/src/declarativeimports/plasmacomponents3/TextArea.qml index 4222f100c..7585892c1 100644 --- a/src/declarativeimports/plasmacomponents3/TextArea.qml +++ b/src/declarativeimports/plasmacomponents3/TextArea.qml @@ -1,113 +1,114 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private import org.kde.kirigami 2.5 as Kirigami +import "mobiletextselection" as MobileTextSelection T.TextArea { id: control implicitWidth: Math.max(contentWidth + leftPadding + rightPadding, background ? background.implicitWidth : 0, placeholder.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(contentHeight + topPadding + bottomPadding, background ? background.implicitHeight : 0, placeholder.implicitHeight + topPadding + bottomPadding) padding: 6 color: theme.viewTextColor selectionColor: theme.highlightColor selectedTextColor: theme.highlightedTextColor opacity: control.enabled ? 1 : 0.6 wrapMode: Text.WordWrap verticalAlignment: TextEdit.AlignTop hoverEnabled: !Kirigami.Settings.tabletMode // Work around Qt bug where NativeRendering breaks for non-integer scale factors // https://bugreports.qt.io/browse/QTBUG-67007 renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering selectByMouse: !Kirigami.Settings.tabletMode cursorDelegate: Kirigami.Settings.tabletMode ? mobileCursor : null Component { id: mobileCursor Private.MobileCursor { target: control } } onPressAndHold: { if (!Kirigami.Settings.tabletMode) { return; } forceActiveFocus(); cursorPosition = positionAt(event.x, event.y); selectWord(); } - Private.MobileCursor { + MobileTextSelection.MobileCursor { target: control selectionStartHandle: true property var rect: target.positionToRectangle(target.selectionStart) x: rect.x y: rect.y } onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = control; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = control; } } Label { id: placeholder x: control.leftPadding y: control.topPadding width: control.width - (control.leftPadding + control.rightPadding) height: control.height - (control.topPadding + control.bottomPadding) text: control.placeholderText font: control.font color: theme.viewTextColor horizontalAlignment: control.horizontalAlignment verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight } background: Item { Private.TextFieldFocus { state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "hidden") anchors.fill: parent } PlasmaCore.FrameSvgItem { id: base anchors.fill: parent imagePath: "widgets/lineedit" prefix: "base" } } } diff --git a/src/declarativeimports/plasmacomponents3/TextField.qml b/src/declarativeimports/plasmacomponents3/TextField.qml index 1395bbf95..aa501bd67 100644 --- a/src/declarativeimports/plasmacomponents3/TextField.qml +++ b/src/declarativeimports/plasmacomponents3/TextField.qml @@ -1,110 +1,111 @@ /* * Copyright 2016 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore import "private" as Private import org.kde.kirigami 2.5 as Kirigami +import "mobiletextselection" as MobileTextSelection T.TextField { id: control implicitWidth: Math.max(units.gridUnit * 8, placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0) || contentWidth + leftPadding + rightPadding implicitHeight: units.gridUnit * 1.6 padding: 6 color: theme.viewTextColor selectionColor: theme.highlightColor selectedTextColor: theme.highlightedTextColor verticalAlignment: TextInput.AlignVCenter opacity: control.enabled ? 1 : 0.6 hoverEnabled: !Kirigami.Settings.tabletMode // Work around Qt bug where NativeRendering breaks for non-integer scale factors // https://bugreports.qt.io/browse/QTBUG-67007 renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering selectByMouse: !Kirigami.Settings.tabletMode cursorDelegate: Kirigami.Settings.tabletMode ? mobileCursor : null Component { id: mobileCursor - Private.MobileCursor { + MobileTextSelection.MobileCursor { target: control } } onFocusChanged: { if (focus) { - Private.MobileTextActionsToolBar.controlRoot = control; + MobileTextSelection.MobileTextActionsToolBar.controlRoot = control; } } onPressAndHold: { if (!Kirigami.Settings.tabletMode) { return; } forceActiveFocus(); cursorPosition = positionAt(event.x, event.y); selectWord(); } Private.MobileCursor { target: control selectionStartHandle: true property var rect: target.positionToRectangle(target.selectionStart) //FIXME: this magic values seem to be always valid, for every font,every dpi, every scaling x: rect.x + 5 y: rect.y + 6 } Label { id: placeholder x: control.leftPadding y: control.topPadding width: control.width - (control.leftPadding + control.rightPadding) height: control.height - (control.topPadding + control.bottomPadding) text: control.placeholderText font: control.font color: theme.viewTextColor opacity: 0.5 horizontalAlignment: control.horizontalAlignment verticalAlignment: control.verticalAlignment visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) elide: Text.ElideRight } background: Item { Private.TextFieldFocus { state: control.activeFocus ? "focus" : (control.hovered ? "hover" : "hidden") anchors.fill: parent } PlasmaCore.FrameSvgItem { id: base anchors.fill: parent imagePath: "widgets/lineedit" prefix: "base" } } } diff --git a/src/declarativeimports/plasmacomponents3/private/MobileCursor.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml similarity index 100% rename from src/declarativeimports/plasmacomponents3/private/MobileCursor.qml rename to src/declarativeimports/plasmacomponents3/mobiletextselection/MobileCursor.qml diff --git a/src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml similarity index 98% rename from src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml rename to src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml index d4df4f1c8..9b14748da 100644 --- a/src/declarativeimports/plasmacomponents3/private/MobileTextActionsToolBar.qml +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/MobileTextActionsToolBar.qml @@ -1,84 +1,83 @@ /* * Copyright (C) 2018 by Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ pragma Singleton import QtQuick 2.1 import QtQuick.Layouts 1.2 import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ -import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kirigami 2.5 as Kirigami Popup { id: root property Item controlRoot parent: controlRoot ? controlRoot.Window.contentItem : undefined modal: false focus: false closePolicy: Popup.NoAutoClose x: controlRoot ? Math.min(Math.max(0, controlRoot.mapToItem(root.parent, controlRoot.positionToRectangle(controlRoot.selectionStart).x, 0).x - root.width/2), controlRoot.Window.contentItem.width - root.width) : 0 y: { if (!controlRoot) { return false; } var desiredY = controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionStart).y).y - root.height; if (desiredY >= 0) { return Math.min(desiredY, controlRoot.Window.contentItem.height - root.height); } else { return Math.min(Math.max(0, controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionEnd).y + Math.round(units.gridUnit*1.5)).y), controlRoot.Window.contentItem.height - root.height); } } visible: controlRoot ? Kirigami.Settings.tabletMode && (controlRoot.selectedText.length > 0 || controlRoot.canPaste) : false width: contentItem.implicitWidth + leftPadding + rightPadding contentItem: RowLayout { ToolButton { focusPolicy: Qt.NoFocus icon.name: "edit-cut" visible: controlRoot.selectedText.length > 0 onClicked: { controlRoot.cut(); } } ToolButton { focusPolicy: Qt.NoFocus icon.name: "edit-copy" visible: controlRoot.selectedText.length > 0 onClicked: { controlRoot.copy(); } } ToolButton { focusPolicy: Qt.NoFocus icon.name: "edit-paste" onClicked: { controlRoot.paste(); } } } } - + diff --git a/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir b/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir new file mode 100644 index 000000000..7b5d9be27 --- /dev/null +++ b/src/declarativeimports/plasmacomponents3/mobiletextselection/qmldir @@ -0,0 +1,3 @@ + +singleton MobileTextActionsToolBar 1.0 MobileTextActionsToolBar.qml +MobileCursor 1.0 MobileCursor.qml diff --git a/src/declarativeimports/plasmacomponents3/private/qmldir b/src/declarativeimports/plasmacomponents3/private/qmldir index 1a9e8d038..d91a06928 100644 --- a/src/declarativeimports/plasmacomponents3/private/qmldir +++ b/src/declarativeimports/plasmacomponents3/private/qmldir @@ -1,7 +1,5 @@ -singleton MobileTextActionsToolBar 1.0 MobileTextActionsToolBar.qml ButtonShadow 1.0 ButtonShadow.qml DefaultListItemBackground 1.0 DefaultListItemBackground.qml -MobileCursor 1.0 MobileCursor.qml RoundShadow 1.0 RoundShadow.qml TextFieldFocus 1.0 TextFieldFocus.qml