File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,15 +66,14 @@ def _show(self) -> None:
6666 x = self .widget .winfo_rootx () + 20
6767 y = self .widget .winfo_rooty () + self .widget .winfo_height () + 5
6868
69- self .tip_window = tk .Toplevel (self .widget )
69+ self .tip_window = tk .Toplevel (self .widget , class_ = "Tooltip" )
7070 self .tip_window .wm_overrideredirect (True )
7171 self .tip_window .wm_geometry (f"+{ x } +{ y } " )
7272
7373 label = tk .Label (
7474 self .tip_window ,
7575 text = self .text ,
7676 justify = "left" ,
77- background = "#f0f0f0" ,
7877 relief = "solid" ,
7978 borderwidth = 1 ,
8079 padx = 6 ,
Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ dict set ui_color selected_background #0078D7
99dict set ui_color text #333333
1010dict set ui_color selected_foreground #FFFFFF
1111
12+ if {[tk windowingsystem] eq " aqua" } {
13+ dict set ui_color tooltip_background systemWindowBackgroundColor
14+ dict set ui_color tooltip_foreground systemTextColor
15+ } else {
16+ dict set ui_color tooltip_background #F0F0F0
17+ dict set ui_color tooltip_foreground [dict get $ui_color text]
18+ }
19+
1220option add *selectedBackground [dict get $ui_color selected_background]
1321option add *selectedForeground [dict get $ui_color selected_foreground]
1422
@@ -19,3 +27,6 @@ option add *Entry.Font [dict get $font default]
1927option add *LabelFrame.Font [dict get $font small]
2028
2129option add *LabelFrame.relief solid
30+
31+ option add *Tooltip*background [dict get $ui_color tooltip_background]
32+ option add *Tooltip*foreground [dict get $ui_color tooltip_foreground]
You can’t perform that action at this time.
0 commit comments