Skip to content

Commit

Permalink
Fix unable to move subwindow.
Browse files Browse the repository at this point in the history
Ensure we grab the attribute from the window it's using, and then move
the **WIDGET** and not the window.

Closes #105.
  • Loading branch information
Alexhuszagh committed Sep 8, 2024
1 parent 23cf68a commit dd6cd2f
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 dd6cd2f

Please sign in to comment.