Verified Commit e80cbf12 authored by Carl Schwan's avatar Carl Schwan 🌈

Use ActionTextField to implement the searchField in system settings

Summary:
Needs Kirigami latest version (master) and D19314

**Warning:** Remove the opacity change animation. :(

{F6637862}

Reviewers: #plasma, ngraham

Reviewed By: ngraham

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19315
parent 6e422a78
......@@ -4,7 +4,7 @@ set(PROJECT_VERSION "5.15.80")
project(systemsettings VERSION ${PROJECT_VERSION})
set(QT_MIN_VERSION "5.11.0")
set(KF5_MIN_VERSION "5.54.0")
set(KF5_MIN_VERSION "5.56.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
......
......@@ -20,7 +20,7 @@ import QtQuick 2.3
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Controls 2.0 as QtControls2
import org.kde.kirigami 2.1 as Kirigami
import org.kde.kirigami 2.7 as Kirigami
Kirigami.ScrollablePage {
......@@ -50,7 +50,7 @@ Kirigami.ScrollablePage {
actions: ["configure", "help_contents", "help_about_app", "help_about_kde"]
}
}
QtControls2.TextField {
Kirigami.ActionTextField {
id: searchField
focus: true
Layout.minimumHeight: Layout.maximumHeight
......@@ -60,27 +60,13 @@ Kirigami.ScrollablePage {
onTextChanged: {
systemsettings.categoryModel.filterRegExp = text;
}
MouseArea {
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
rightMargin: y
}
opacity: searchField.text.length > 0 ? 1 : 0
width: Kirigami.Units.iconSizes.small
height: width
onClicked: searchField.text = ""
Kirigami.Icon {
anchors.fill: parent
source: LayoutMirroring.enabled ? "edit-clear-rtl" : "edit-clear"
rightActions: [
Kirigami.Action {
iconName: LayoutMirroring.enabled ? "edit-clear-rtl" : "edit-clear"
visible: searchField.text.length !== 0
onTriggered: searchField.text = ""
}
Behavior on opacity {
OpacityAnimator {
duration: Kirigami.Units.longDuration
easing.type: Easing.InOutQuad
}
}
}
]
}
}
Kirigami.Separator {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment