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

Fatih Uzunoglu fuzun54 at outlook.com
Sat Nov 7 17:53:40 CET 2020


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

diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
index a11f21291a..4a60c156b4 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 == null) ? undefined : parent.verticalCenter
     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..4f3b75c531 100644
--- a/modules/gui/qt/player/qml/ControlButtons.qml
+++ b/modules/gui/qt/player/qml/ControlButtons.qml
@@ -424,10 +424,10 @@ Item{
             LanguageMenu {
                 id: langMenu
 
-                parent: rootPlayer
+                parent: rootPlayer == null ? undefined : rootPlayer
                 focus: true
                 x: 0
-                y: rootPlayer.positionSliderY - height
+                y: rootPlayer == null ? 0 : (rootPlayer.positionSliderY - height)
                 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 8181b0c199..66e6b16e90 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 == null ? 0 : rootPlayer.width
 
     onOpened: {
         control._emitMenuClose = true
-- 
2.25.1



More information about the vlc-devel mailing list