[AI] window
This commit is contained in:
@@ -24,6 +24,9 @@ class OverlayWindow:
|
||||
# Bind drag functionality
|
||||
self.setup_drag()
|
||||
|
||||
# Bind right-click to show context menu for closing
|
||||
self.root.bind("<Button-3>", self.show_context_menu)
|
||||
|
||||
# Update display periodically
|
||||
self.update_display_periodically()
|
||||
|
||||
@@ -90,6 +93,12 @@ class OverlayWindow:
|
||||
widget.bind("<Button-1>", start_move)
|
||||
widget.bind("<B1-Motion>", do_move)
|
||||
|
||||
def show_context_menu(self, event):
|
||||
"""Show context menu with close option"""
|
||||
context_menu = tk.Menu(self.root, tearoff=0)
|
||||
context_menu.add_command(label="Закрыть", command=self.root.quit)
|
||||
context_menu.post(event.x_root, event.y_root)
|
||||
|
||||
def toggle_tracking(self):
|
||||
"""Toggle tracking state"""
|
||||
self.tracker.toggle_tracking()
|
||||
|
||||
Reference in New Issue
Block a user