@@ -30,7 +30,6 @@ def __init__(self, parent):
3030 ["arrow_left" , "arrow_right" ])
3131 self .set_text_view (None )
3232 context = self .find_entry .get_style_context ()
33- self .orig_base_color = context .get_background_color (Gtk .StateFlags .NORMAL )
3433 self .arrow_left .show ()
3534 self .arrow_right .show ()
3635 parent .connect ('set-focus-child' , self .on_focus_child )
@@ -127,8 +126,7 @@ def on_replace_all_button_clicked(self, entry):
127126 buf .get_insert (), 0.25 , True , 0.5 , 0.5 )
128127
129128 def on_find_entry_changed (self , entry ):
130- entry .override_background_color (Gtk .StateType .NORMAL ,
131- self .orig_base_color )
129+ self .find_entry .get_style_context ().remove_class ("not-found" )
132130 self ._find_text (0 )
133131
134132 def _find_text (self , start_offset = 1 , backwards = False , wrap = True ):
@@ -166,11 +164,5 @@ def _find_text(self, start_offset=1, backwards=False, wrap=True):
166164 return True
167165 else :
168166 buf .place_cursor (buf .get_iter_at_mark (buf .get_insert ()))
169- # FIXME: Even though docs suggest this should work, it does
170- # not. It just sets the selection colour on the text, without
171- # affecting the entry colour at all.
172- color = Gdk .RGBA ()
173- color .parse ("#ffdddd" )
174- self .find_entry .override_background_color (
175- Gtk .StateType .NORMAL , color )
167+ self .find_entry .get_style_context ().add_class ("not-found" )
176168 self .wrap_box .set_visible (False )
0 commit comments