def on_option_set(self, event, settings, option): """ Updates appearance on setting change """ if option == 'plugin/osd/format': self.info_area.set_info_format(settings.get_option(option, _('<span font_desc="Sans 11" foreground="#fff"><b>$title</b></span>\n' 'by $artist\n' 'from $album') )) if option == 'plugin/osd/background': self.__options['background'] = alphacolor_parse(settings.get_option(option, '#333333cc')) GLib.idle_add(self.queue_draw) elif option == 'plugin/osd/display_duration': self.__options['display_duration'] = int(settings.get_option(option, 4)) elif option == 'plugin/osd/show_progress': self.info_area.set_display_progress(settings.get_option(option, True)) elif option == 'plugin/osd/position': position = Point._make(settings.get_option(option, [20, 20])) GLib.idle_add(self.move, position.x, position.y) elif option == 'plugin/osd/border_radius': value = settings.get_option(option, 10) self.set_border_width(max(6, int(value / 2))) self.__options['border_radius'] = value self.emit('size-allocate', self.get_allocation())
def on_option_set(self, event, settings, option): """ Updates appearance on setting change """ if option == 'plugin/osd/format': self.info_area.set_info_format(settings.get_option(option, _('<span font_desc="Sans 11" foreground="#fff"><b>$title</b></span>\n' 'by $artist\n' 'from $album') )) if option == 'plugin/osd/background': self.__options['background'] = alphacolor_parse(settings.get_option(option, '#333333cc')) glib.idle_add(self.queue_draw) elif option == 'plugin/osd/display_duration': self.__options['display_duration'] = int(settings.get_option(option, 4)) elif option == 'plugin/osd/show_progress': self.info_area.set_display_progress(settings.get_option(option, True)) elif option == 'plugin/osd/position': position = Point._make(settings.get_option(option, [20, 20])) glib.idle_add(self.move, position.x, position.y) elif option == 'plugin/osd/border_radius': value = settings.get_option(option, 10) self.set_border_width(max(6, int(value / 2))) self.__options['border_radius'] = value self.emit('size-allocate', self.get_allocation())
def _set_value(self): color = alphacolor_parse( self.preferences.settings.get_option(self.name, self.default)) self.widget.set_color(gtk.gdk.Color(color.red, color.green, color.blue)) self.widget.set_alpha(color.alpha)
def _set_value(self): color = alphacolor_parse(self.preferences.settings.get_option(self.name, self.default)) self.widget.set_color(Gdk.Color(color.red, color.green, color.blue)) self.widget.set_alpha(color.alpha)