def create_tag(self, buffer, color): tag = buffer.create_tag() set_widget_color(tag, self.frame.np.config.sections["ui"][color]) set_widget_font(tag, self.frame.np.config.sections["ui"]["chatfont"]) return tag
def update_tag_visuals(self, tag, color): set_widget_color(tag, self.frame.np.config.sections["ui"][color]) set_widget_font(tag, self.frame.np.config.sections["ui"]["chatfont"]) if color in ("useraway", "useronline", "useroffline"): usernamestyle = self.frame.np.config.sections["ui"]["usernamestyle"] if usernamestyle == "bold": tag.set_property("weight", Pango.Weight.BOLD) else: tag.set_property("weight", Pango.Weight.NORMAL) if usernamestyle == "italic": tag.set_property("style", Pango.Style.ITALIC) else: tag.set_property("style", Pango.Style.NORMAL) if usernamestyle == "underline": tag.set_property("underline", Pango.Underline.SINGLE) else: tag.set_property("underline", Pango.Underline.NONE)