Disable expand on double click in search mode

This commit is contained in:
RumovZ 2021-03-09 20:18:12 +01:00
parent 3f772ce0fe
commit a9ea7e39ae

View File

@ -399,11 +399,14 @@ class SidebarTreeView(QTreeView):
if tool == SidebarTool.SEARCH:
selection_mode = QAbstractItemView.SingleSelection
drag_drop_mode = QAbstractItemView.NoDragDrop
double_click_expands = False
else:
selection_mode = QAbstractItemView.ExtendedSelection
drag_drop_mode = QAbstractItemView.InternalMove
double_click_expands = True
self.setSelectionMode(selection_mode)
self.setDragDropMode(drag_drop_mode)
self.setExpandsOnDoubleClick(double_click_expands)
def model(self) -> SidebarModel:
return super().model()