GTK3: convert deprecated code for the indicator in entryfield

svn: r22518
This commit is contained in:
Benny Malengier 2013-06-19 06:56:06 +00:00
parent 5c0b6dd023
commit 8b37ca4119

View File

@ -180,15 +180,17 @@ class MonitoredEntryIndicator(MonitoredEntry):
autolist=None, changed=None): autolist=None, changed=None):
MonitoredEntry.__init__(self, obj, set_val, get_val, read_only, MonitoredEntry.__init__(self, obj, set_val, get_val, read_only,
autolist, changed) autolist, changed)
self.origcolor = obj.get_style_context().get_color(Gtk.StateType.NORMAL)
if get_val(): if get_val():
self.indicatorshown = False self.indicatorshown = False
else: else:
self.indicatorshown = True self.indicatorshown = True
self.indicator = indicator self.indicator = indicator
self.obj.set_text(indicator) self.obj.set_text(indicator)
self.obj.modify_text(Gtk.StateType.NORMAL, rgba = Gdk.RGBA()
Gdk.color_parse('grey')) Gdk.RGBA.parse(rgba, 'grey')
self.obj.modify_font(Pango.FontDescription('sans italic')) self.obj.override_color(Gtk.StateType.NORMAL, rgba)
self.obj.override_font(Pango.FontDescription('sans italic'))
self.fockey = self.obj.connect('focus-in-event', self.fockey = self.obj.connect('focus-in-event',
self._obj_focus) self._obj_focus)
@ -203,8 +205,8 @@ class MonitoredEntryIndicator(MonitoredEntry):
callback for when prefix obtains focus callback for when prefix obtains focus
""" """
self.set_text('') self.set_text('')
self.obj.modify_text(Gtk.StateType.NORMAL, Gdk.color_parse('black')) self.obj.override_color(Gtk.StateType.NORMAL, self.origcolor)
self.obj.modify_font(Pango.FontDescription('normal')) self.obj.override_font(Pango.FontDescription('normal'))
self.obj.disconnect(self.fockey) self.obj.disconnect(self.fockey)
self.indicatorshown = False self.indicatorshown = False
return False return False