[vlc-commits] [Git][videolan/vlc][master] qml: fix network addressbar home button
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Sun Apr 3 13:51:36 UTC 2022
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
f34f5a77 by Prince Gupta at 2022-04-03T13:33:11+00:00
qml: fix network addressbar home button
Widgets.PageLoader/StackViewExt: load default page if viewProperties is empty
fixup 9457692d9a1446fef7b9ab3e9847944446f4e054
- - - - -
2 changed files:
- modules/gui/qt/widgets/qml/PageLoader.qml
- modules/gui/qt/widgets/qml/StackViewExt.qml
Changes:
=====================================
modules/gui/qt/widgets/qml/PageLoader.qml
=====================================
@@ -36,6 +36,12 @@ FocusScope {
loadView()
}
+ // loads the 'defaultPage'
+ // this will also apend History.current with the 'defaultPage' entry
+ function loadDefaultView() {
+ view = null
+ }
+
function loadView() {
if (view === null) {
var defaultView = {"name": defaultPage, "properties": {}}
=====================================
modules/gui/qt/widgets/qml/StackViewExt.qml
=====================================
@@ -62,9 +62,13 @@ StackView {
root.currentItem.dismiss()
if (view === _currentView) {
- for ( var viewProp in viewProperties ) {
- if ( root.currentItem.hasOwnProperty(viewProp) ) {
- root.currentItem[viewProp] = viewProperties[viewProp]
+ if (Object.keys(viewProperties).length === 0 && root.currentItem.hasOwnProperty("loadDefaultView") ) {
+ root.currentItem.loadDefaultView()
+ } else {
+ for ( var viewProp in viewProperties ) {
+ if ( root.currentItem.hasOwnProperty(viewProp) ) {
+ root.currentItem[viewProp] = viewProperties[viewProp]
+ }
}
}
return true
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f34f5a77a973903eddd6a672bd2d6e601077234b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f34f5a77a973903eddd6a672bd2d6e601077234b
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list