def _set_color(self, state, widget, option): ''' set color value in prefs and update the UI ''' if state: color = widget.get_color() color_string = gtkgui_helpers.make_color_string(color) else: color_string = '' gajim.config.set_per('themes', self.current_theme, self.current_option + option, color_string) # use faster functions for this if self.current_option == 'banner': gajim.interface.roster.repaint_themed_widgets() gajim.interface.save_config() return if self.no_update: return gajim.interface.roster.change_roster_style(self.current_option) gajim.interface.save_config()
def _set_color(self, state, widget, option): """ Set color value in prefs and update the UI """ if state: color = widget.get_color() color_string = gtkgui_helpers.make_color_string(color) else: color_string = '' begin_option = '' if not option.startswith('state'): begin_option = self.current_option gajim.config.set_per('themes', self.current_theme, begin_option + option, color_string) # use faster functions for this if self.current_option == 'banner': gajim.interface.roster.repaint_themed_widgets() return if self.no_update: return gajim.interface.roster.change_roster_style(self.current_option)
def color_set(self, widget, response, color): if response == -6: widget.destroy() return _buffer = self.get_buffer() color = color.get_current_color() widget.destroy() color_string = gtkgui_helpers.make_color_string(color) tag_name = "color" + color_string if not tag_name in self.color_tags: tagColor = _buffer.create_tag(tag_name) tagColor.set_property("foreground", color_string) self.begin_tags[tag_name] = '<span style="color: ' + color_string + ';">' self.end_tags[tag_name] = "</span>" self.color_tags.append(tag_name) start, finish = self.get_active_iters() for tag in self.color_tags: _buffer.remove_tag_by_name(tag, start, finish) _buffer.apply_tag_by_name(tag_name, start, finish)