Changeset View
Changeset View
Standalone View
Standalone View
mobile/app/package/contents/ui/Thumbnails.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public | 14 | * You should have received a copy of the GNU General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.1 | 20 | import QtQuick 2.1 | ||
21 | import QtQuick.Controls 2.0 | 21 | import QtQuick.Controls 2.0 | ||
22 | import org.kde.kirigami 2.0 as Kirigami | 22 | import org.kde.kirigami 2.7 as Kirigami | ||
23 | 23 | | |||
24 | ThumbnailsBase { | 24 | ThumbnailsBase { | ||
25 | id: root | 25 | id: root | ||
26 | model: documentItem.matchingPages | 26 | model: documentItem.matchingPages | ||
27 | 27 | | |||
28 | ToolBar { | 28 | ToolBar { | ||
29 | id: toolBarContent | 29 | id: toolBarContent | ||
30 | width: root.width | 30 | width: root.width | ||
31 | height: searchField.height | 31 | height: searchField.height + Kirigami.Units.largeSpacing | ||
32 | TextField { | 32 | Kirigami.ActionTextField { | ||
33 | id: searchField | 33 | id: searchField | ||
34 | enabled: documentItem ? documentItem.supportsSearching : false | | |||
35 | anchors.centerIn: parent | 34 | anchors.centerIn: parent | ||
35 | rightActions: [ | ||||
36 | Kirigami.Action { | ||||
37 | iconName: "edit-clear" | ||||
38 | visible: searchField.text != "" | ||||
aacid: This needs to be !== to be 0.00000004 nanoseconds faster (same in the other file) | |||||
39 | onTriggered: { | ||||
40 | searchField.text = "" | ||||
41 | searchField.accepted() | ||||
42 | } | ||||
43 | } | ||||
44 | ] | ||||
45 | enabled: documentItem ? documentItem.supportsSearching : false | ||||
46 | placeholderText: documentItem && documentItem.supportsSearching ? i18n("Search...") : i18n("This document isn't searchable.") | ||||
47 | focusSequence: "Ctrl+F" | ||||
36 | onTextChanged: { | 48 | onTextChanged: { | ||
37 | if (text.length > 2) { | 49 | if (text.length > 2) { | ||
38 | documentItem.searchText(text); | 50 | documentItem.searchText(text); | ||
39 | } else { | 51 | } else { | ||
40 | documentItem.resetSearch(); | 52 | documentItem.resetSearch(); | ||
41 | } | 53 | } | ||
42 | } | 54 | } | ||
43 | } | 55 | } | ||
Show All 10 Lines |
This needs to be !== to be 0.00000004 nanoseconds faster (same in the other file)