@@ -135,7 +135,7 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
135135 style .configure ("left.tkfilebrowser.Treeview.Heading" ,
136136 font = "TkDefaultFont" )
137137 style .configure ("left.tkfilebrowser.Treeview.Item" , padding = 2 )
138- style .configure ("listbox.TFrame" , background = "white" , relief = "sunken" )
138+ style .configure ("listbox.tkfilebrowser. TFrame" , background = "white" , relief = "sunken" )
139139 field_bg = style .lookup ("TEntry" , "fieldbackground" , default = 'white' )
140140 tree_field_bg = style .lookup ("ttk.Treeview" , "fieldbackground" ,
141141 default = 'white' )
@@ -145,22 +145,25 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
145145 sel_fg = style .lookup ('Treeview' , 'foreground' , ('selected' ,))
146146 self .option_add ('*TCombobox*Listbox.selectBackground' , sel_bg )
147147 self .option_add ('*TCombobox*Listbox.selectForeground' , sel_fg )
148- style .map ('types.TCombobox' , foreground = [], fieldbackground = [])
149- style .configure ('types.TCombobox' , lightcolor = bg ,
148+ style .map ('types.tkfilebrowser. TCombobox' , foreground = [], fieldbackground = [])
149+ style .configure ('types.tkfilebrowser. TCombobox' , lightcolor = bg ,
150150 fieldbackground = bg )
151- style .configure ('types.TCombobox.Item' , background = 'red' )
151+ style .configure ('types.tkfilebrowser. TCombobox.Item' , background = 'red' )
152152 style .configure ("left.tkfilebrowser.Treeview" , background = active_bg ,
153153 font = "TkDefaultFont" ,
154154 fieldbackground = active_bg )
155155 self .configure (background = bg )
156156 # path button style
157- style .configure ("path.TButton" , padding = 2 )
157+ style .configure ("path.tkfilebrowser. TButton" , padding = 2 )
158158 selected_bg = style .lookup ("TButton" , "background" , ("pressed" ,))
159159 map_bg = style .map ("TButton" , "background" )
160160 map_bg .append (("selected" , selected_bg ))
161- style .map ("path.TButton" ,
161+ style .map ("path.tkfilebrowser. TButton" ,
162162 background = map_bg ,
163163 font = [("selected" , "TkDefaultFont 9 bold" )])
164+ # tooltip style
165+ style .configure ('tooltip.tkfilebrowser.TLabel' , background = 'black' ,
166+ foreground = 'white' )
164167
165168 # --- images
166169 self .im_file = tk .PhotoImage (file = cst .IM_FILE , master = self )
@@ -185,7 +188,7 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
185188 w = max ([len (f ) for f in values ] + [5 ])
186189 b_filetype = ttk .Combobox (self , textvariable = self .filetype ,
187190 state = 'readonly' ,
188- style = 'types.TCombobox' ,
191+ style = 'types.tkfilebrowser. TCombobox' ,
189192 values = values ,
190193 width = w )
191194 b_filetype .grid (row = 3 , sticky = "e" , padx = 10 , pady = (4 , 0 ))
@@ -203,7 +206,7 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
203206 # --- path completion
204207 self .complete = self .register (self ._completion )
205208 self .listbox_var = tk .StringVar (self )
206- self .listbox_frame = ttk .Frame (self , style = "listbox.TFrame" , borderwidth = 1 )
209+ self .listbox_frame = ttk .Frame (self , style = "listbox.tkfilebrowser. TFrame" , borderwidth = 1 )
207210 self .listbox = tk .Listbox (self .listbox_frame ,
208211 listvariable = self .listbox_var ,
209212 highlightthickness = 0 ,
@@ -265,8 +268,7 @@ def __init__(self, parent, initialdir="", initialfile="", mode="openfile",
265268 paned .add (left_pane , weight = 0 )
266269 self .left_tree = ttk .Treeview (left_pane , selectmode = "browse" ,
267270 style = "left.tkfilebrowser.Treeview" )
268- wrapper = TooltipTreeWrapper (self .left_tree , background = 'black' ,
269- foreground = 'white' )
271+ wrapper = TooltipTreeWrapper (self .left_tree )
270272 self .left_tree .column ("#0" , width = 150 )
271273 self .left_tree .heading ("#0" , text = _ ("Shortcuts" ), anchor = "w" )
272274 self .left_tree .grid (row = 0 , column = 0 , sticky = "sewn" )
@@ -926,7 +928,7 @@ def _update_path_bar(self, path):
926928 b = PathButton (self .path_bar , self .path_var , p , text = folder ,
927929 width = len (folder ) + 1 ,
928930 command = lambda f = p : self .display_folder (f ),
929- style = "path.TButton" )
931+ style = "path.tkfilebrowser. TButton" )
930932 self .path_bar_buttons .append (b )
931933 b .grid (row = 0 , column = i + 2 , sticky = "ns" )
932934
0 commit comments