[vlc-devel] [PATCH 13/55] qml: force disable all buttons in toolbareditor

Fatih Uzunoglu fuzun54 at outlook.com
Thu Jan 7 21:36:26 UTC 2021


D&D does not work when a button is enabled. This patch ensures that all buttons are forcefully disabled.
---
 .../dialogs/toolbar/qml/EditorDNDDelegate.qml |  5 ++++-
 modules/gui/qt/player/qml/ControlButtons.qml  | 19 ++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
index 0f05fbbeea..8107cb2279 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
@@ -117,7 +117,10 @@ MouseArea {
                 verticalCenter: parent.verticalCenter
             }
             sourceComponent: controlButtons.returnbuttondelegate(model.id)
-            onLoaded: buttonloader.item.paintOnly = true
+            onLoaded: {
+                buttonloader.item.paintOnly = true
+                buttonloader.item.enabled = false
+            }
 
         }
 
diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml
index 25c3615ba9..5c530b3c36 100644
--- a/modules/gui/qt/player/qml/ControlButtons.qml
+++ b/modules/gui/qt/player/qml/ControlButtons.qml
@@ -162,7 +162,6 @@ Item{
             property bool acceptFocus: true
 
             property bool paintOnly: false
-            enabled: !paintOnly
 
             property bool realHovered: false
 
@@ -369,7 +368,7 @@ Item{
             size: VLCStyle.icon_medium
             iconText: VLCIcons.dvd_prev
             onClicked: player.chapterPrev()
-            enabled: !paintOnly && player.hasChapters
+            enabled: player.hasChapters
             property bool acceptFocus: visible
             text: i18n.qtr("Previous chapter")
         }
@@ -383,7 +382,7 @@ Item{
             size: VLCStyle.icon_medium
             iconText: VLCIcons.dvd_next
             onClicked: player.chapterNext()
-            enabled: !paintOnly && player.hasChapters
+            enabled: player.hasChapters
             property bool acceptFocus: visible
             text: i18n.qtr("Next chapter")
         }
@@ -535,7 +534,7 @@ Item{
         Widgets.IconToolButton{
             id: fullScreenBtn
             size: VLCStyle.icon_medium
-            enabled: !paintOnly && player.hasVideoOutput
+            enabled: player.hasVideoOutput
             iconText: player.fullscreen ? VLCIcons.defullscreen :VLCIcons.fullscreen
             onClicked: player.fullscreen = !player.fullscreen
             property bool acceptFocus: true
@@ -549,7 +548,7 @@ Item{
             id: recordBtn
             size: VLCStyle.icon_medium
             iconText: VLCIcons.record
-            enabled: !paintOnly && player.isPlaying
+            enabled: player.isPlaying
             checked: player.isRecording
             onClicked: player.toggleRecord()
             property bool acceptFocus: true
@@ -586,7 +585,7 @@ Item{
         Widgets.IconToolButton{
             id: snapshotBtn
             size: VLCStyle.icon_medium
-            enabled: !paintOnly && player.isPlaying
+            enabled: player.isPlaying
             iconText: VLCIcons.snapshot
             onClicked: player.snapshot()
             property bool acceptFocus: true
@@ -600,7 +599,7 @@ Item{
         Widgets.IconToolButton{
             id: stopBtn
             size: VLCStyle.icon_medium
-            enabled: !paintOnly && player.isPlaying
+            enabled: player.isPlaying
             iconText: VLCIcons.stop
             onClicked: mainPlaylistController.stop()
             property bool acceptFocus: true
@@ -613,7 +612,7 @@ Item{
         Widgets.IconToolButton{
             id: infoBtn
             size: VLCStyle.icon_medium
-            enabled: !paintOnly && player.isPlaying
+            enabled: player.isPlaying
             iconText: VLCIcons.info
             onClicked: dialogProvider.mediaInfoDialog()
             property bool acceptFocus: true
@@ -627,7 +626,7 @@ Item{
         Widgets.IconToolButton{
             id: frameBtn
             size: VLCStyle.icon_medium
-            enabled: !paintOnly && player.isPlaying
+            enabled: player.isPlaying
             iconText: VLCIcons.frame_by_frame
             onClicked: player.frameNext()
             property bool acceptFocus: true
@@ -725,7 +724,6 @@ Item{
         id: aspectRatioDelegate
         Widgets.ComboBoxExt {
             property bool paintOnly: false
-            enabled: !paintOnly
             Layout.alignment: Qt.AlignVCenter
             width: VLCStyle.combobox_width_normal
             height: VLCStyle.combobox_height_normal
@@ -753,7 +751,6 @@ Item{
 
         Widgets.IconToolButton{
             size: VLCStyle.icon_medium
-            enabled: !paintOnly
             iconText: VLCIcons.fullscreen
 
             onClicked: {
-- 
2.27.0



More information about the vlc-devel mailing list