Skip to content

Commit

Permalink
Fix small regression which re-enables ability to edit File name and F…
Browse files Browse the repository at this point in the history
…ile tags on details view by double clicking. Double clicking the thumbnail (column 0) still launches preview dialog.
  • Loading branch information
jonoomph committed Oct 6, 2024
1 parent 663fc44 commit af436da
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/windows/views/files_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,18 @@ def contextMenuEvent(self, event):
menu.popup(event.globalPos())

def mouseDoubleClickEvent(self, event):
super(FilesTreeView, self).mouseDoubleClickEvent(event)
# Preview File, File Properties, or Split File (depending on Shift/Ctrl)
if int(get_app().keyboardModifiers() & Qt.ShiftModifier) > 0:
get_app().window.actionSplitFile.trigger()
elif int(get_app().keyboardModifiers() & Qt.ControlModifier) > 0:
get_app().window.actionFile_Properties.trigger()
# Get the index of the item at the click position
index = self.indexAt(event.pos())
if index.column() == 0:
# If column 0 (thumbnail) is double-clicked, trigger the custom actions
if int(get_app().keyboardModifiers() & Qt.ShiftModifier) > 0:
get_app().window.actionSplitFile.trigger()
elif int(get_app().keyboardModifiers() & Qt.ControlModifier) > 0:
get_app().window.actionFile_Properties.trigger()
else:
get_app().window.actionPreview_File.trigger()
else:
get_app().window.actionPreview_File.trigger()
super(FilesTreeView, self).mouseDoubleClickEvent(event)

def dragEnterEvent(self, event):
# If dragging urls onto widget, accept
Expand Down

0 comments on commit af436da

Please sign in to comment.