Skip to content

Commit

Permalink
Merge pull request #108 from Alexhuszagh/issue_105
Browse files Browse the repository at this point in the history
Fix unable to move subwindow.
  • Loading branch information
Alexhuszagh authored Sep 8, 2024
2 parents 23cf68a + dd6cd2f commit 5255b18
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions example/titlebar.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,8 @@ def start_drag(self, event, window_type):

def handle_drag(self, event, window, window_type):
'''Handle the window drag event.'''

position = event.pos() - getattr(self, f'_{window_type}_drag')
window.move_to(window.mapToParent(position))
position = event.pos() - getattr(window, f'_{window_type}_drag')
self.move_to(self.mapToParent(position))


def end_drag(self, window_type):
Expand All @@ -563,7 +562,6 @@ def end_drag(self, window_type):

def start_move(self, widget, window_type):
'''Start the window move state.'''

setattr(self, f'_{window_type}_move', widget)
widget.menu_move_to(QtGui.QCursor.pos())

Expand Down

0 comments on commit 5255b18

Please sign in to comment.