Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/DashboardRepresentation.qml
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Line(s) | 240 | DashboardTabBar { | |||
---|---|---|---|---|---|
253 | 253 | | |||
254 | onHoveredTabChanged: updateWidgetExplorer() | 254 | onHoveredTabChanged: updateWidgetExplorer() | ||
255 | 255 | | |||
256 | Keys.onDownPressed: { | 256 | Keys.onDownPressed: { | ||
257 | mainColumn.tryActivate(0, 0); | 257 | mainColumn.tryActivate(0, 0); | ||
258 | } | 258 | } | ||
259 | } | 259 | } | ||
260 | 260 | | |||
261 | PlasmaComponents.TextField { | 261 | TextEdit { | ||
262 | id: searchField | 262 | id: searchField | ||
263 | 263 | | |||
264 | width: 0 | 264 | width: 0 | ||
265 | height: 0 | 265 | height: 0 | ||
266 | 266 | | |||
267 | visible: false | 267 | visible: false | ||
268 | 268 | | |||
269 | persistentSelection: true | ||||
270 | | ||||
269 | onTextChanged: { | 271 | onTextChanged: { | ||
270 | if (tabBar.activeTab == 0) { | 272 | if (tabBar.activeTab == 0) { | ||
271 | runnerModel.query = searchField.text; | 273 | runnerModel.query = searchField.text; | ||
272 | } else { | 274 | } else { | ||
273 | widgetExplorer.widgetsModel.searchTerm = searchField.text; | 275 | widgetExplorer.widgetsModel.searchTerm = searchField.text; | ||
274 | } | 276 | } | ||
275 | } | 277 | } | ||
276 | 278 | | |||
277 | function clear() { | 279 | function clear() { | ||
278 | text = ""; | 280 | text = ""; | ||
279 | } | 281 | } | ||
282 | | ||||
283 | onSelectionStartChanged: Qt.callLater(searchHeading.updateSelection) | ||||
284 | onSelectionEndChanged: Qt.callLater(searchHeading.updateSelection) | ||||
280 | } | 285 | } | ||
281 | 286 | | |||
282 | PlasmaExtras.Heading { | 287 | TextEdit { | ||
broulik: This change will change to `QtRendering` (which could be sensible on that large font size… | |||||
I was debating this. If I use QQC2.TextField, I have to do stuff to remove the default background and for proper sizing. If I use PlasmaComponents.TextArea it's similar. If I set renderType, it won't benefit from what PlasmaComponents and qqc2-desktop-style do wrt/ switching to QtRendering on non-integer scale factors. hein: I was debating this. If I use `QQC2.TextField`, I have to do stuff to remove the default… | |||||
283 | id: searchHeading | 288 | id: searchHeading | ||
284 | 289 | | |||
285 | anchors { | 290 | anchors { | ||
286 | horizontalCenter: parent.horizontalCenter | 291 | horizontalCenter: parent.horizontalCenter | ||
287 | } | 292 | } | ||
288 | 293 | | |||
289 | y: (middleRow.anchors.topMargin / 2) - (smallScreen ? (height/10) : 0) | 294 | y: (middleRow.anchors.topMargin / 2) - (smallScreen ? (height/10) : 0) | ||
290 | 295 | | |||
291 | font.pointSize: dummyHeading.font.pointSize * 1.5 | 296 | font.pointSize: dummyHeading.font.pointSize * 1.5 | ||
292 | | ||||
293 | elide: Text.ElideRight | | |||
294 | wrapMode: Text.NoWrap | 297 | wrapMode: Text.NoWrap | ||
295 | opacity: 1.0 | 298 | opacity: 1.0 | ||
296 | 299 | | |||
297 | color: "white" | 300 | selectByMouse: false | ||
301 | cursorVisible: false | ||||
298 | 302 | | |||
299 | level: 1 | 303 | color: "white" | ||
300 | 304 | | |||
301 | text: searching ? i18n("Searching for '%1'", searchField.text) : i18n("Type to search.") | 305 | text: searching ? i18n("Searching for '%1'", searchField.text) : i18n("Type to search.") | ||
306 | | ||||
307 | function updateSelection() { | ||||
308 | if (!searchField.selectedText) { | ||||
309 | return; | ||||
310 | } | ||||
311 | | ||||
312 | var delta = text.lastIndexOf(searchField.text, text.length - 2); | ||||
313 | searchHeading.select(searchField.selectionStart + delta, searchField.selectionEnd + delta); | ||||
314 | } | ||||
302 | } | 315 | } | ||
303 | 316 | | |||
304 | PlasmaComponents.ToolButton { | 317 | PlasmaComponents.ToolButton { | ||
305 | id: cancelSearchButton | 318 | id: cancelSearchButton | ||
306 | 319 | | |||
307 | anchors { | 320 | anchors { | ||
308 | left: searchHeading.right | 321 | left: searchHeading.right | ||
309 | leftMargin: units.largeSpacing | 322 | leftMargin: units.largeSpacing | ||
▲ Show 20 Lines • Show All 761 Lines • Show Last 20 Lines |
This change will change to QtRendering (which could be sensible on that large font size, though, but just so you're aware)