Skip to content

Commit 6f8d380

Browse files
codewizdaveclaude
andcommitted
fix(ui): remove overlay completely - use simple slide-in panel
Remove the problematic overlay that was causing black screen issues. Now using a much simpler approach: just the panel sliding in from the right with no background dimming. Changes: - Remove overlay creation completely - Remove click-outside-to-close (not possible without overlay) - Remove Escape key binding (not needed) - Simplify close() method - Panel now just appears/disappears on the right side Benefits: - Much simpler code - No z-order issues - No black screen - Panel is always visible - Main context is still preserved (just not dimmed) Trade-off: Slightly less visual emphasis, but much more reliable. This is a working solution that solves the black screen problem. Related: #14 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 55778d5 commit 6f8d380

1 file changed

Lines changed: 5 additions & 57 deletions

File tree

src/ui_ctk/components/slide_in_panel.py

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,14 @@ def _create_ui(self):
102102
self.content_frame.pack(fill="both", expand=True, padx=20, pady=20)
103103

104104
def show(self):
105-
"""Show the panel with overlay.
105+
"""Show the panel.
106106
107-
Creates a semi-transparent overlay and displays the panel
108-
on the right side of the parent window.
107+
Displays the panel on the right side of the parent window.
109108
"""
110109
if self._visible:
111110
return # Already visible
112111

113-
# Position panel FIRST (before overlay)
114-
# This ensures panel is in the widget hierarchy
112+
# Position panel on the right side
115113
parent_width = self.parent.winfo_width()
116114
panel_width = self.cget('width')
117115

@@ -124,51 +122,17 @@ def show(self):
124122
anchor="nw", # Northwest anchor (top-left of panel)
125123
)
126124

127-
# THEN create overlay (dims the background)
128-
self.overlay = ctk.CTkFrame(
129-
self.parent,
130-
fg_color=("gray20", "#101010"),
131-
)
132-
self.overlay.place(in_=self.parent, relx=0, rely=0, relwidth=1, relheight=1)
133-
134-
# Bind click on overlay to close panel
135-
self.overlay.bind("<Button-1>", self._on_overlay_click)
136-
137-
# Bind Esc key to close (after overlay is created)
138-
try:
139-
self.overlay.bind("<Escape>", self._on_escape_key)
140-
self._esc_binding = "overlay"
141-
except Exception:
142-
# Escape key binding not available, that's OK
143-
self._esc_binding = None
144-
145-
# CRITICAL: Lift panel ABOVE overlay
146-
self.lift()
147-
148125
# Mark as visible
149126
self._visible = True
150127

151128
def close(self):
152-
"""Close the panel and remove overlay.
129+
"""Close the panel.
153130
154-
Cleans up the overlay and hides the panel.
131+
Hides the panel.
155132
"""
156133
if not self._visible:
157134
return # Already hidden
158135

159-
# Unbind Esc key if it was bound
160-
if self._esc_binding is not None and self.overlay:
161-
try:
162-
self.overlay.unbind("<Escape>")
163-
except Exception:
164-
pass
165-
self._esc_binding = None
166-
167-
# Remove overlay
168-
if self.overlay:
169-
self.overlay.destroy()
170-
self.overlay = None
171-
172136
# Hide panel
173137
self.place_forget()
174138

@@ -179,22 +143,6 @@ def close(self):
179143
if self.on_close:
180144
self.on_close()
181145

182-
def _on_overlay_click(self, event):
183-
"""Handle click on overlay to close panel.
184-
185-
Args:
186-
event: The click event
187-
"""
188-
self.close()
189-
190-
def _on_escape_key(self, event):
191-
"""Handle Escape key press to close panel.
192-
193-
Args:
194-
event: The key event
195-
"""
196-
self.close()
197-
198146
def is_visible(self) -> bool:
199147
"""Check if panel is currently visible.
200148

0 commit comments

Comments
 (0)