[vlc-devel] [PATCH 18/18] qml: right clicking selected items in table view should not reset selection

Pierre Lamot pierre at videolabs.io
Wed Sep 23 14:27:52 CEST 2020


---
 modules/gui/qt/widgets/qml/KeyNavigableTableView.qml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
index 52c2547b19..3e37fb5788 100644
--- a/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
+++ b/modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
@@ -221,9 +221,11 @@ NavigableFocusScope {
                 acceptedButtons: Qt.RightButton | Qt.LeftButton
 
                 onClicked: {
-                    selectionDelegateModel.updateSelection( mouse.modifiers , view.currentIndex, index)
-                    view.currentIndex = rowModel.index
-                    lineView.forceActiveFocus()
+                    if (mouse.button === Qt.LeftButton || !selectionDelegateModel.isSelected(root.model.index(index, 0))) {
+                        selectionDelegateModel.updateSelection( mouse.modifiers , view.currentIndex, index)
+                        view.currentIndex = rowModel.index
+                        lineView.forceActiveFocus()
+                    }
 
                     if (mouse.button === Qt.RightButton){
                         root.rightClick(lineView,rowModel, hoverArea.mapToGlobal(mouse.x,mouse.y) )
-- 
2.25.1



More information about the vlc-devel mailing list