Skip to content

Commit

Permalink
Merge pull request #197 from ceccopierangiolieugenio/dev
Browse files Browse the repository at this point in the history
TTkList Widget: dnd is disable by default to avoid unexpected dragging.
  • Loading branch information
ceccopierangiolieugenio authored Oct 25, 2023
2 parents 1254df3 + 5fe92d6 commit 2c8105d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions TermTk/TTkCore/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ class DragDropMode(int):
'''Drag allowed'''
AllowDrop = 0x02
'''Drop allowed'''
NoDragDrop = DragDropMode.NoDragDrop
AllowDrag = DragDropMode.AllowDrag
AllowDrop = DragDropMode.AllowDrop
AllowDragDrop = 0x03
'''Drag and Drop allowed'''
NoDragDrop = DragDropMode.NoDragDrop
AllowDrag = DragDropMode.AllowDrag
AllowDrop = DragDropMode.AllowDrop
AllowDragDrop = DragDropMode.AllowDragDrop

class ChildIndicatorPolicy(int):
ShowIndicator = 0x00 #The controls for expanding and collapsing will be shown for this item even if there are no children.
Expand Down
3 changes: 1 addition & 2 deletions TermTk/TTkWidgets/listwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ def __init__(self, *args, **kwargs):
self._items = []
self._highlighted = None
self._dragPos = None
self._dndMode = kwargs.get("dragDropMode",
TTkK.DragDropMode.AllowDrag | TTkK.DragDropMode.AllowDrop )
self._dndMode = kwargs.get("dragDropMode", TTkK.DragDropMode.NoDragDrop)
# Signals
self.itemClicked = pyTTkSignal(TTkAbstractListItem)
self.textClicked = pyTTkSignal(str)
Expand Down

0 comments on commit 2c8105d

Please sign in to comment.