Launcher search box clear icon
This commit is contained in:
parent
916f2d7d76
commit
0f83a71860
3 changed files with 7 additions and 8 deletions
BIN
src/GUI/assets/icons8-clear-symbol-26.png
Normal file
BIN
src/GUI/assets/icons8-clear-symbol-26.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 242 B |
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue