Skip to content

Commit

Permalink
Fix issue with widget stacking
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Mar 30, 2024
1 parent 8941cbc commit a510c35
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions studio/feature/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ def _adjust_event(self, event):
event.y_root = self.window.drag_window.pos[1] - 1

def on_drag(self, event):
if not self.designer:
return
widget = self.designer.layout_at_pos(*self.window.drag_window.get_center())
if widget and self.window.drag_window:
bounds = geometry.absolute_bounds(self.window.drag_window)
widget.react(bounds)

def on_drag_end(self, event):
if not self.designer:
return
widget = self.designer.layout_at_pos(*self.window.drag_window.get_center())
if isinstance(widget, Container):
bounds = geometry.absolute_bounds(self.window.drag_window)
Expand Down
2 changes: 1 addition & 1 deletion studio/lib/layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _update_stacking(self):
if index > 0:
widget.lift(self.children[index - 1])
else:
widget.lift(self.container)
widget.lift(self.container.body)

def widget_released(self, widget):
pass
Expand Down
6 changes: 6 additions & 0 deletions studio/lib/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ def __init__(self, master, id_):
self.id = id_
self.setup_widget()

def lift(self, above_this=None):
return tk.Misc.lift(self, above_this)

def lower(self, below_this=None, *_):
return tk.Misc.lower(self, below_this)


class Checkbutton(PseudoWidget, tk.Checkbutton):
display_name = 'Checkbutton'
Expand Down

0 comments on commit a510c35

Please sign in to comment.