File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ class Base:
15
15
code_editor_language = 'text'
16
16
modification_changed = Signal (object , bool )
17
17
received_focus = Signal (object )
18
+ lost_focus = Signal (object )
18
19
19
20
def __init__ (self , * args , ** kwargs ):
20
21
# Optionally set the language. This is mainly for generic editors that
@@ -52,6 +53,13 @@ def focusInEvent(self, event):
52
53
"""
53
54
super ().focusInEvent (event )
54
55
self .received_focus .emit (self )
56
+
57
+ def focusOutEvent (self , event ):
58
+ """Allows managing widgets, such as the editor panel, to keep track of
59
+ which editor is active
60
+ """
61
+ super ().focusOutEvent (event )
62
+ self .lost_focus .emit (self )
55
63
56
64
def refresh (self ):
57
65
"""Can be called to indicate that the interface needs to be refreshed,
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def wheelEvent(self, event):
99
99
self ._cm_completion_popup .hide ()
100
100
101
101
def focusOutEvent (self , event ):
102
- """Make sure the calltip doesn't stay open when we scroll the viewport .
102
+ """Make sure the calltip doesn't stay open when the widget loses focus .
103
103
"""
104
104
super ().focusOutEvent (event )
105
105
self ._cm_hide_calltip ()
@@ -516,9 +516,7 @@ def _cm_show_calltip(self, text):
516
516
global_pos = global_bottom_left
517
517
logger .info ("Positioning calltip below cursor." )
518
518
519
- print (f'intended position: { global_pos } ' )
520
519
self ._cm_calltip_widget .move (global_pos )
521
- print (f'actual position: { self ._cm_calltip_widget .pos ()} ' )
522
520
self ._cm_calltip_widget .show ()
523
521
524
522
def closeEvent (self , event ):
You can’t perform that action at this time.
0 commit comments