Skip to content

Commit

Permalink
[STUDIO] Show container names when hovering
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Jul 27, 2024
1 parent afabe98 commit 27f40f6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions studio/lib/handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, widget, master=None):
self.active_direction = None
self.dots = []
self.edges = []
self.label = None
self._hover = False
self._showing = False
self.allow_move = False
Expand Down Expand Up @@ -147,6 +148,8 @@ def unhover(self):
return
for edge in self.edges:
edge.place_forget()
if self.label:
self.label.place_forget()
self._hover = False
self.redraw()
if not self._showing:
Expand Down Expand Up @@ -209,6 +212,14 @@ def redraw(self):
if self._hover:
if not self.edges:
self.edges = [Edge(self) for _ in range(4)]
if not self.label:
self.label = tk.Label(self.master, **self.master.style.text_small)
self.label.config(bg=self.master.style.colors["accent"], fg="#ffffff")
self.label.config(text=f"{self.widget.id}")
self.label.place(
in_=self.master, bordermode="outside",
x=self.widget.winfo_x(), y=self.widget.winfo_y(), anchor="sw"
)
extra = dict(in_=self.widget, bordermode="outside")
n, s, e, w = self.edges
n.place(**extra, x=0, y=0, relwidth=1)
Expand Down

0 comments on commit 27f40f6

Please sign in to comment.