Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/SearchField.qml
Show All 38 Lines | 26 | { | |||
---|---|---|---|---|---|
39 | } | 39 | } | ||
40 | onAccepted: { | 40 | onAccepted: { | ||
41 | currentSearchText = text | 41 | currentSearchText = text | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | hoverEnabled: true | 44 | hoverEnabled: true | ||
45 | ToolTip { | 45 | ToolTip { | ||
46 | delay: Kirigami.Units.longDuration | 46 | delay: Kirigami.Units.longDuration | ||
47 | visible: hovered | 47 | visible: hovered && searchField.text.length === 0 | ||
broulik: Prefer using `length` as that avoids copying a string into JS space | |||||
48 | text: searchAction.shortcut | 48 | text: searchAction.shortcut | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | function clearText() { | 51 | function clearText() { | ||
52 | searchField.text = "" | 52 | searchField.text = "" | ||
53 | searchField.accepted() | 53 | searchField.accepted() | ||
54 | } | 54 | } | ||
55 | 55 | | |||
Show All 26 Lines |
Prefer using length as that avoids copying a string into JS space