Browse Source

qml: automatically request focus in `MainViewLoader` loaded item

So that we don't need to use `focus: true` in every main view.
We can do this because main views are expected to request focus.

Currently views in `VideoAll` are missing this, instead of setting
them there, I thought that this approach would be less fragile.

Focus reason is a different matter and is not handled here.
pull/183/head
Fatih Uzunoglu 10 months ago
committed by Steve Lhomme
parent
commit
0693cd9ae7
  1. 9
      modules/gui/qt/maininterface/qml/MainViewLoader.qml

9
modules/gui/qt/maininterface/qml/MainViewLoader.qml

@ -224,4 +224,13 @@ Loader {
sourceComponent: emptyLabel
}
// The encapsulating Loader is a focus scope. If it has active focus,
// is there any reason why its loaded item would not have focus?
Binding {
target: root.currentItem
when: root.activeFocus
property: "focus"
value: true
}
}

Loading…
Cancel
Save