def show_new_content(self, tree_view): model, it = tree_view.get_selection().get_selected() if model and it: self.get_info_from_headline(model[it]) self.color_headline(model[it], string_to_RGBA(self.appearance()['Read Color'])) item = self.gatherer.item(self.last_item_feed_name, self.last_item_index) if item.article: TextFormat.prepare_content_display(item, self.content_view) else: self.gatherer.request(item)
def confirm_and_reset_defaults(self, widget): if utilityFunctions.decision_popup(self.parent, 'Reset appearance to defaults?', 'Are you sure you want to reset your appearance preferences to default values?'): self.choices = Preferences.default_appearance_preferences() # Visual Effects # Set the view combo box to "Double" which is the second entry model = self.view_box.get_model() self.view_box.set_active_iter(model.iter_next(model.get_iter_first())) # Set the font buttons to display the default font values for fb, fi in zip(self.font_buttons, self.font_idents): fb.set_font_name(self.choices[fi]) fb.emit("font_set") # Set the color buttons to display the default color values for cb, ci in zip(self.color_buttons, self.color_idents): cb.set_rgba(utilityFunctions.string_to_RGBA(self.choices[ci]))
def confirm_and_reset_defaults(self, widget: Gtk.Widget) -> None: if utilityFunctions.decision_popup( self.parent, 'Reset appearance to defaults?', 'Are you sure you want to reset your appearance preferences to default values?' ): self.choices = Preferences.default_appearance_preferences() # Visual Effects # Set the view combo box to "Double" which is the second entry model = self.view_box.get_model() self.view_box.set_active_iter( model.iter_next(model.get_iter_first())) # Set the font buttons to display the default font values for fb, fi in zip(self.font_buttons, self.font_idents): fb.set_font_name(self.css_to_font_name(self.choices[fi])) # Set the color buttons to display the default color values for cb, ci in zip(self.color_buttons, self.color_idents): cb.set_rgba(utilityFunctions.string_to_RGBA(self.choices[ci]))
def get_color(self, appearance_dict): keys = ['Font Color', 'Filtered Color', 'Read Color'] color_string = appearance_dict[keys[self.ranking()]] return string_to_RGBA(color_string)