[vlc-devel] [PATCH 02/27] qml: fix TypeError in toolbareditor

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:37 CET 2020


---
 modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml | 2 +-
 modules/gui/qt/player/qml/ControlButtons.qml             | 2 +-
 modules/gui/qt/player/qml/LanguageMenu.qml               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
index a11f21291a..0f05fbbeea 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
@@ -31,7 +31,7 @@ MouseArea {
     property bool held: false
     property bool dropVisible: false
     property var dndView: null
-    anchors.verticalCenter: parent.verticalCenter
+    anchors.verticalCenter: (!!parent) ? parent.verticalCenter : undefined
     cursorShape: Qt.OpenHandCursor
     drag.target: held ? content : undefined
     width: buttonloader.width
diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml
index 244ee030e9..8e736c894a 100644
--- a/modules/gui/qt/player/qml/ControlButtons.qml
+++ b/modules/gui/qt/player/qml/ControlButtons.qml
@@ -427,7 +427,7 @@ Item{
                 parent: rootPlayer
                 focus: true
                 x: 0
-                y: rootPlayer.positionSliderY - height
+                y: (!!rootPlayer) ? (rootPlayer.positionSliderY - height) : 0
                 z: 1
 
                 onOpened: rootPlayer._menu = langMenu
diff --git a/modules/gui/qt/player/qml/LanguageMenu.qml b/modules/gui/qt/player/qml/LanguageMenu.qml
index 75751a4d44..321419162f 100644
--- a/modules/gui/qt/player/qml/LanguageMenu.qml
+++ b/modules/gui/qt/player/qml/LanguageMenu.qml
@@ -40,7 +40,7 @@ T.Menu {
     cascade: false
     closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
     height: VLCStyle.dp(296, VLCStyle.scale)
-    width: rootPlayer.width
+    width: (!!rootPlayer) ? rootPlayer.width : 0
 
     onOpened: {
         control._emitMenuClose = true
-- 
2.27.0



More information about the vlc-devel mailing list