mirror of
https://github.com/onionshare/onionshare.git
synced 2025-09-20 20:44:50 -04:00
More thoroughly remove drag and drop to prevent the drop label from getting created
This commit is contained in:
parent
293a24a48d
commit
36a2132887
1 changed files with 15 additions and 0 deletions
|
@ -185,6 +185,11 @@ class FileList(QtWidgets.QListWidget):
|
||||||
"""
|
"""
|
||||||
dragEnterEvent for dragging files and directories into the widget.
|
dragEnterEvent for dragging files and directories into the widget.
|
||||||
"""
|
"""
|
||||||
|
# Drag and drop doesn't work in Flatpak, because of the sandbox
|
||||||
|
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
|
|
||||||
if event.mimeData().hasUrls:
|
if event.mimeData().hasUrls:
|
||||||
self.setStyleSheet(self.common.gui.css["share_file_list_drag_enter"])
|
self.setStyleSheet(self.common.gui.css["share_file_list_drag_enter"])
|
||||||
count = len(event.mimeData().urls())
|
count = len(event.mimeData().urls())
|
||||||
|
@ -206,6 +211,11 @@ class FileList(QtWidgets.QListWidget):
|
||||||
"""
|
"""
|
||||||
dragLeaveEvent for dragging files and directories into the widget.
|
dragLeaveEvent for dragging files and directories into the widget.
|
||||||
"""
|
"""
|
||||||
|
# Drag and drop doesn't work in Flatpak, because of the sandbox
|
||||||
|
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
|
|
||||||
self.setStyleSheet(self.common.gui.css["share_file_list_drag_leave"])
|
self.setStyleSheet(self.common.gui.css["share_file_list_drag_leave"])
|
||||||
self.drop_count.hide()
|
self.drop_count.hide()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
@ -215,6 +225,11 @@ class FileList(QtWidgets.QListWidget):
|
||||||
"""
|
"""
|
||||||
dragMoveEvent for dragging files and directories into the widget.
|
dragMoveEvent for dragging files and directories into the widget.
|
||||||
"""
|
"""
|
||||||
|
# Drag and drop doesn't work in Flatpak, because of the sandbox
|
||||||
|
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
|
||||||
|
event.ignore()
|
||||||
|
return
|
||||||
|
|
||||||
if event.mimeData().hasUrls:
|
if event.mimeData().hasUrls:
|
||||||
event.setDropAction(QtCore.Qt.CopyAction)
|
event.setDropAction(QtCore.Qt.CopyAction)
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue