mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
Partially revert "don't select contiguously with shift+click"
I thought this could work, but users (including myself!) are used to
being able to shift+click to select a region, and this behaviour is
surprising. We're also doing potentially expensive searches for each
extra selected item. I think we may need to switch this behaviour to
the right mouse button instead.
This partially reverts commit c91d21e18e
.
This commit is contained in:
parent
2a0bc15a0b
commit
09dfbfe2b9
1 changed files with 0 additions and 12 deletions
|
@ -396,18 +396,6 @@ class SidebarTreeView(QTreeView):
|
||||||
else:
|
else:
|
||||||
super().keyPressEvent(event)
|
super().keyPressEvent(event)
|
||||||
|
|
||||||
# don't extend selection when shift+clicking with mouse (conflicts
|
|
||||||
# with OR-ing). User can still shift+up/down to select contiguously.
|
|
||||||
def selectionCommand(
|
|
||||||
self, index: QModelIndex, event: QEvent = None
|
|
||||||
) -> QItemSelectionModel.SelectionFlags:
|
|
||||||
flags = super().selectionCommand(index, event)
|
|
||||||
mods = self.mw.app.keyboardModifiers()
|
|
||||||
if isinstance(event, QMouseEvent) and mods & Qt.ShiftModifier:
|
|
||||||
# pylint: disable=no-member
|
|
||||||
flags &= ~QItemSelectionModel.SelectionFlag.Current # type: ignore
|
|
||||||
return flags
|
|
||||||
|
|
||||||
###########
|
###########
|
||||||
|
|
||||||
def handle_drag_drop(self, sources: List[SidebarItem], target: SidebarItem) -> bool:
|
def handle_drag_drop(self, sources: List[SidebarItem], target: SidebarItem) -> bool:
|
||||||
|
|
Loading…
Reference in a new issue