diff --git a/org.kde.desktop/BusyIndicator.qml b/org.kde.desktop/BusyIndicator.qml --- a/org.kde.desktop/BusyIndicator.qml +++ b/org.kde.desktop/BusyIndicator.qml @@ -53,7 +53,7 @@ from: 0 to: 360 loops: Animation.Infinite - duration: 1000 + duration: 2000 } } } diff --git a/org.kde.desktop/ComboBox.qml b/org.kde.desktop/ComboBox.qml --- a/org.kde.desktop/ComboBox.qml +++ b/org.kde.desktop/ComboBox.qml @@ -206,6 +206,7 @@ Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.inherit: controlRoot.Kirigami.Theme.inherit modal: true + closePolicy: Controls.Popup.CloseOnEscape | Controls.Popup.CloseOnPressOutside contentItem: ListView { id: listView diff --git a/org.kde.desktop/private/MobileTextActionsToolBar.qml b/org.kde.desktop/private/MobileTextActionsToolBar.qml --- a/org.kde.desktop/private/MobileTextActionsToolBar.qml +++ b/org.kde.desktop/private/MobileTextActionsToolBar.qml @@ -35,11 +35,16 @@ closePolicy: Popup.NoAutoClose property bool shouldBeVisible: false - 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 + x: { + if (!controlRoot || !controlRoot.Window.contentItem) { + return 0; + } + return 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); + } y: { - if (!controlRoot) { - return false; + if (!controlRoot || !controlRoot.Window.contentItem) { + return 0; } var desiredY = controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionStart).y).y - root.height; diff --git a/tests/LineEditWithClearButton.qml b/tests/LineEditWithClearButton.qml new file mode 100644 --- /dev/null +++ b/tests/LineEditWithClearButton.qml @@ -0,0 +1,35 @@ +/* + Copyright (c) 2019 Montel Laurent + + This library 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 of the License or + ( at your option ) version 3 or, at the discretion of KDE e.V. + ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. + + This library 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 library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +import org.kde.kirigami 2.7 as Kirigami +Kirigami.ActionTextField { + id: __searchField + focus: true + rightActions: [ + Kirigami.Action { + iconName: "edit-clear" + visible: __searchField.text !== "" + onTriggered: { + __searchField.text = "" + __searchField.accepted() + } + } + ] +}