1
0
Fork 0

Launcher search box clear icon

This commit is contained in:
James Turner 2018-07-05 00:36:46 +01:00
parent 916f2d7d76
commit 0f83a71860
3 changed files with 7 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

View file

@ -30,6 +30,8 @@ FocusScope
root.search("");
}
readonly property bool canClear: (buttonText.text.length > 0)
Rectangle
{
id: frame
@ -41,8 +43,6 @@ FocusScope
border.color: (mouse.containsMouse | active) ? Style.themeColor: Style.minorFrameColor
clip: true
TextInput {
id: buttonText
anchors.left: parent.left
@ -86,7 +86,7 @@ FocusScope
Image {
id: searchIcon
source: clearButtonMouse.containsMouse ? "qrc:///up-down-arrow" :"qrc:///search-icon-small"
source: root.canClear ? "qrc:///clear-text-icon" :"qrc:///search-icon-small"
anchors.right: parent.right
anchors.rightMargin: Style.margin
anchors.verticalCenter: parent.verticalCenter
@ -113,11 +113,9 @@ FocusScope
anchors.right: parent.right
height: parent.height
width: searchIcon.width
hoverEnabled: true
onClicked: {
clear();
}
hoverEnabled: root.canClear
visible: root.canClear
onClicked: clear();
}
Timer {

View file

@ -108,6 +108,7 @@
<file>qml/ToggleBox.qml</file>
<file>qml/LocationAltitudeRow.qml</file>
<file>qml/CatalogDelegate.qml</file>
<file alias="clear-text-icon">assets/icons8-clear-symbol-26.png</file>
</qresource>
<qresource prefix="/preview">
<file alias="close-icon">preview-close.png</file>