fix: Prevent tooltip from stealing focus and closing modal dialog
- Removed dpg.focus_item() call that was stealing focus - Added no_bring_to_front_on_focus=True to prevent focus stealing - Removed no_open_over_existing_popup parameter 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6650280421
commit
0317ea2a5b
|
|
@ -499,7 +499,7 @@ class DiscussionGUI:
|
||||||
self._tooltip_alpha = 1.0
|
self._tooltip_alpha = 1.0
|
||||||
self._tooltip_last_mouse_pos = mouse_pos
|
self._tooltip_last_mouse_pos = mouse_pos
|
||||||
|
|
||||||
# Create tooltip as a popup window (appears above modal)
|
# Create tooltip as a non-modal, non-focusable window
|
||||||
with dpg.window(
|
with dpg.window(
|
||||||
tag="dictate_tooltip_window",
|
tag="dictate_tooltip_window",
|
||||||
no_title_bar=True,
|
no_title_bar=True,
|
||||||
|
|
@ -509,9 +509,9 @@ class DiscussionGUI:
|
||||||
no_collapse=True,
|
no_collapse=True,
|
||||||
no_background=False,
|
no_background=False,
|
||||||
no_focus_on_appearing=True,
|
no_focus_on_appearing=True,
|
||||||
|
no_bring_to_front_on_focus=True,
|
||||||
pos=[tooltip_x, tooltip_y],
|
pos=[tooltip_x, tooltip_y],
|
||||||
autosize=True,
|
autosize=True
|
||||||
no_open_over_existing_popup=False
|
|
||||||
):
|
):
|
||||||
dpg.add_text("Voice Dictation", color=(200, 200, 255))
|
dpg.add_text("Voice Dictation", color=(200, 200, 255))
|
||||||
dpg.add_separator()
|
dpg.add_separator()
|
||||||
|
|
@ -526,9 +526,6 @@ class DiscussionGUI:
|
||||||
dpg.add_text("Tip: Type at insertion point first", color=(255, 200, 100))
|
dpg.add_text("Tip: Type at insertion point first", color=(255, 200, 100))
|
||||||
dpg.add_text("to set cursor position.", color=(255, 200, 100))
|
dpg.add_text("to set cursor position.", color=(255, 200, 100))
|
||||||
|
|
||||||
# Bring tooltip to front
|
|
||||||
dpg.focus_item("dictate_tooltip_window")
|
|
||||||
|
|
||||||
def _hide_dictate_tooltip(self):
|
def _hide_dictate_tooltip(self):
|
||||||
"""Hide the custom dictate button tooltip immediately."""
|
"""Hide the custom dictate button tooltip immediately."""
|
||||||
if dpg.does_item_exist("dictate_tooltip_window"):
|
if dpg.does_item_exist("dictate_tooltip_window"):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue