Changeset View
Changeset View
Standalone View
Standalone View
src/apps/marble-maps/Search.qml
Context not available. | |||||
8 | // Copyright 2015 Gábor Péterffy <peterffy95@gmail.com> | 8 | // Copyright 2015 Gábor Péterffy <peterffy95@gmail.com> | ||
---|---|---|---|---|---|
9 | // | 9 | // | ||
10 | 10 | | |||
11 | import QtQuick 2.3 | 11 | import QtQuick 2.7 | ||
12 | import QtQuick.Controls 2.0 | 12 | import QtQuick.Controls 2.0 | ||
13 | import QtQuick.Window 2.2 | 13 | import QtQuick.Window 2.2 | ||
14 | 14 | | |||
Context not available. | |||||
73 | 73 | | |||
74 | Column { | 74 | Column { | ||
75 | anchors.top: parent.top | 75 | anchors.top: parent.top | ||
76 | anchors.topMargin: background.itemSpacing | | |||
77 | anchors.left: parent.left | 76 | anchors.left: parent.left | ||
78 | anchors.right: parent.right | 77 | anchors.right: parent.right | ||
79 | anchors.margins: background.itemSpacing | | |||
80 | spacing: background.itemSpacing | 78 | spacing: background.itemSpacing | ||
81 | 79 | | |||
82 | ListView { | 80 | ListView { | ||
Context not available. | |||||
93 | height: background.itemSpacing + Math.max(bookmarkIcon.height, bookmarkText.height) | 91 | height: background.itemSpacing + Math.max(bookmarkIcon.height, bookmarkText.height) | ||
94 | spacing: background.itemSpacing | 92 | spacing: background.itemSpacing | ||
95 | 93 | | |||
94 | leftPadding: 10 | ||||
95 | rightPadding: 10 | ||||
96 | | ||||
96 | Image { | 97 | Image { | ||
97 | id: bookmarkIcon | 98 | id: bookmarkIcon | ||
98 | anchors.verticalCenter: parent.verticalCenter | 99 | anchors.verticalCenter: parent.verticalCenter | ||
Context not available. | |||||
109 | anchors.leftMargin: Screen.pixelDensity * 2 | 110 | anchors.leftMargin: Screen.pixelDensity * 2 | ||
110 | width: bookmarksView.width - bookmarksView.spacing - bookmarkIcon.width | 111 | width: bookmarksView.width - bookmarksView.spacing - bookmarkIcon.width | ||
111 | text: display | 112 | text: display | ||
112 | font.pointSize: 18 | 113 | font.pointSize: 14 | ||
113 | color: palette.text | 114 | color: palette.text | ||
114 | elide: Text.ElideMiddle | 115 | elide: Text.ElideMiddle | ||
115 | 116 | | |||
Context not available. | |||||
136 | Row { | 137 | Row { | ||
137 | visible: bookmarksView.model.count === 0 | 138 | visible: bookmarksView.model.count === 0 | ||
138 | width: parent.width | 139 | width: parent.width | ||
140 | anchors.left: parent.left | ||||
141 | anchors.right: parent.right | ||||
142 | spacing: Screen.pixelDensity * 2 | ||||
143 | anchors.margins: Screen.pixelDensity * 2 | ||||
139 | 144 | | |||
140 | Text { | 145 | Text { | ||
141 | anchors.bottom: parent.bottom | 146 | anchors.bottom: parent.bottom | ||
142 | width: 0.8 * parent.width | 147 | leftPadding: 10 | ||
143 | font.pointSize: 18 | 148 | bottomPadding: 3 | ||
149 | width: parent.width - Screen.pixelDensity * 2 - emptyImage.width | ||||
150 | font.pointSize: 14 | ||||
144 | color: paletteDisabled.text | 151 | color: paletteDisabled.text | ||
145 | text: qsTr("Your bookmarks will appear here.") | 152 | text: qsTr("Your bookmarks will appear here.") | ||
153 | | ||||
146 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere | 154 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere | ||
147 | elide: Text.ElideRight | 155 | elide: Text.ElideRight | ||
148 | } | 156 | } | ||
149 | 157 | | |||
150 | Image { | 158 | Image { | ||
159 | id: emptyImage | ||||
151 | anchors.bottom: parent.bottom | 160 | anchors.bottom: parent.bottom | ||
152 | width: 0.2 * parent.width | 161 | width: Screen.pixelDensity* 10 | ||
162 | | ||||
153 | fillMode: Image.PreserveAspectFit | 163 | fillMode: Image.PreserveAspectFit | ||
154 | source: "qrc:/konqi/books.png" | 164 | source: "qrc:/konqi/books.png" | ||
155 | } | 165 | } | ||
Context not available. | |||||
169 | 179 | | |||
170 | SearchField { | 180 | SearchField { | ||
171 | id: searchField | 181 | id: searchField | ||
172 | width: parent.width - 2 * anchors.margins <= Screen.pixelDensity * 70 ? | 182 | width: parent.width | ||
173 | parent.width - 2 * anchors.margins | | |||
174 | : Screen.pixelDensity * 50 | | |||
175 | anchors { | 183 | anchors { | ||
176 | top: parent.top | 184 | top: parent.top | ||
177 | left: parent.left | 185 | left: parent.left | ||
178 | margins: Screen.pixelDensity * 3 | 186 | right: parent.right | ||
179 | } | 187 | } | ||
180 | completionModel: backend.completionModel | 188 | completionModel: backend.completionModel | ||
181 | onSearchRequested: backend.search(query) | 189 | onSearchRequested: backend.search(query) | ||
Context not available. |