Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/MenuRepresentation.qml
Show First 20 Lines • Show All 370 Lines • ▼ Show 20 Line(s) | 354 | State { | |||
---|---|---|---|---|---|
371 | } | 371 | } | ||
372 | }] | 372 | }] | ||
373 | 373 | | |||
374 | Keys.onPressed: { | 374 | Keys.onPressed: { | ||
375 | if (event.key == Qt.Key_Up) { | 375 | if (event.key == Qt.Key_Up) { | ||
376 | if (rootList.visible) { | 376 | if (rootList.visible) { | ||
377 | rootList.showChildDialogs = false; | 377 | rootList.showChildDialogs = false; | ||
378 | rootList.currentIndex = rootList.model.count - 1; | 378 | rootList.currentIndex = rootList.model.count - 1; | ||
379 | rootList.forceActiveFocus(); | ||||
379 | rootList.showChildDialogs = true; | 380 | rootList.showChildDialogs = true; | ||
380 | } | 381 | } | ||
381 | 382 | | |||
382 | if (runnerColumns.visible) { | 383 | if (runnerColumns.visible) { | ||
383 | for (var i = 0; i < runnerModel.count; ++i) { | 384 | for (var i = 0; i < runnerModel.count; ++i) { | ||
384 | if (runnerModel.modelForRow(i).count) { | 385 | if (runnerModel.modelForRow(i).count) { | ||
385 | runnerColumnsRepeater.itemAt(i).currentIndex = runnerModel.modelForRow(i).count - 1; | 386 | var targetList = runnerColumnsRepeater.itemAt(i); | ||
387 | targetList.currentIndex = runnerModel.modelForRow(i).count - 1; | ||||
388 | targetList.forceActiveFocus(); | ||||
386 | break; | 389 | break; | ||
387 | } | 390 | } | ||
388 | } | 391 | } | ||
389 | } | 392 | } | ||
390 | } else if (event.key == Qt.Key_Down) { | 393 | } else if (event.key == Qt.Key_Down) { | ||
391 | if (rootList.visible) { | 394 | if (rootList.visible) { | ||
392 | rootList.showChildDialogs = false; | 395 | rootList.showChildDialogs = false; | ||
393 | rootList.currentIndex = 0; | 396 | rootList.currentIndex = 0; | ||
397 | rootList.forceActiveFocus(); | ||||
394 | rootList.showChildDialogs = true; | 398 | rootList.showChildDialogs = true; | ||
395 | } | 399 | } | ||
396 | 400 | | |||
397 | if (runnerColumns.visible) { | 401 | if (runnerColumns.visible) { | ||
398 | for (var i = 0; i < runnerModel.count; ++i) { | 402 | for (var i = 0; i < runnerModel.count; ++i) { | ||
399 | if (runnerModel.modelForRow(i).count) { | 403 | if (runnerModel.modelForRow(i).count) { | ||
400 | runnerColumnsRepeater.itemAt(i).currentIndex = 0; | 404 | var targetList = runnerColumnsRepeater.itemAt(i); | ||
405 | targetList.currentIndex = 0; | ||||
406 | targetList.forceActiveFocus(); | ||||
401 | break; | 407 | break; | ||
402 | } | 408 | } | ||
403 | } | 409 | } | ||
404 | } | 410 | } | ||
405 | } else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) { | 411 | } else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) { | ||
406 | if (runnerColumns.visible && runnerModel.modelForRow(0).count) { | 412 | if (runnerColumns.visible && runnerModel.modelForRow(0).count) { | ||
407 | runnerModel.modelForRow(0).trigger(0, "", null); | 413 | runnerModel.modelForRow(0).trigger(0, "", null); | ||
408 | plasmoid.expanded = false; | 414 | plasmoid.expanded = false; | ||
Show All 23 Lines |