Changeset View
Changeset View
Standalone View
Standalone View
lib/qml/ResultsView.qml
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 47 | section { | |||
---|---|---|---|---|---|
49 | property: "type" | 49 | property: "type" | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | // This is used to keep track if the user has pressed enter before | 52 | // This is used to keep track if the user has pressed enter before | ||
53 | // the first result has been shown, in the case the first result should | 53 | // the first result has been shown, in the case the first result should | ||
54 | // be run when the model is populated | 54 | // be run when the model is populated | ||
55 | property bool runAutomatically | 55 | property bool runAutomatically | ||
56 | 56 | | |||
57 | // This is used to disable mouse selection if the user interacts only with keyboard | ||||
58 | property bool moved: false | ||||
59 | property point savedMousePosition: Milou.MouseHelper.globalMousePosition() | ||||
broulik: Since it doesn't have a `NOTIFY` signal won't QML complain about "property depends on non… | |||||
60 | function mouseMovedGlobally() { | ||||
61 | return savedMousePosition != Milou.MouseHelper.globalMousePosition(); | ||||
62 | } | ||||
63 | | ||||
57 | Milou.DragHelper { | 64 | Milou.DragHelper { | ||
58 | id: dragHelper | 65 | id: dragHelper | ||
59 | dragIconSize: units.iconSizes.medium | 66 | dragIconSize: units.iconSizes.medium | ||
60 | } | 67 | } | ||
61 | 68 | | |||
62 | model: Milou.SourcesModel { | 69 | model: Milou.SourcesModel { | ||
63 | id: resultModel | 70 | id: resultModel | ||
64 | queryLimit: 20 | 71 | queryLimit: 20 | ||
65 | 72 | | |||
66 | // Internally when the query string changes, the model is reset | 73 | // Internally when the query string changes, the model is reset | ||
67 | // and the results are presented | 74 | // and the results are presented | ||
68 | onModelReset: { | 75 | onModelReset: { | ||
69 | listView.currentIndex = 0 | 76 | listView.currentIndex = 0 | ||
77 | listView.moved = false | ||||
78 | listView.savedMousePosition = Milou.MouseHelper.globalMousePosition() | ||||
70 | 79 | | |||
71 | if (runAutomatically) { | 80 | if (runAutomatically) { | ||
72 | runCurrentIndex(); | 81 | runCurrentIndex(); | ||
73 | } | 82 | } | ||
74 | } | 83 | } | ||
75 | 84 | | |||
76 | onUpdateSearchTerm: listView.updateQueryString(text, pos) | 85 | onUpdateSearchTerm: listView.updateQueryString(text, pos) | ||
77 | } | 86 | } | ||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |
Since it doesn't have a NOTIFY signal won't QML complain about "property depends on non-NOTIFYable property"?