def __init__(self, share_id, tab_name, label): self.id = u"sharing-%s-%s" % (share_id, tab_name) self.share_id = share_id self.name = label self.type = u'sharing-fake-playlist' self.icon = widgetutil.make_surface("icon-%s" % tab_name) self.active_icon = widgetutil.make_surface("icon-%s_active" % tab_name)
def __init__(self): widgetset.CustomSlider.__init__(self) self.set_can_focus(False) self.set_range(0.0, MAX_VOLUME) self.set_increments(0.05, 0.20) self.track = widgetutil.make_surface('volume_track') self.knob = widgetutil.make_surface('volume_knob')
def _set_from_info(self, guide_info): if guide_info is None: return # XXX This code is a bit ugly, because we want to use pretty defaults for # the Miro Guide, but still allow themes to override if guide_info.default and guide_info.url in _guide_url_to_title_map: self.name = _guide_url_to_title_map[guide_info.url] else: self.name = guide_info.name if guide_info.default and guide_info.url in _guide_url_to_icon_map: # one of our default guides self.icon_name = _guide_url_to_icon_map[guide_info.url] self.icon = widgetutil.make_surface(self.icon_name) elif guide_info.faviconIsDefault: # theme guide that should use default favicon self.icon = widgetutil.make_surface(self.icon_name) else: # theme guide with a favicon surface = imagepool.get_surface(guide_info.favicon) if surface.width != 23 or surface.height != 23: self.icon = imagepool.get_surface(guide_info.favicon, size=(23, 23)) else: self.icon = surface
def __init__(self, tab_class, name, icon_name): # "type" is overused, so tab_class refers to the type class # attribute of the tab. e.g. "connect", "feed", ... self.tab_class = tab_class self.name = name self.id = u'%s-base-tab' % tab_class self.icon_name = icon_name self.thumbnail = resources.path('images/%s.png' % icon_name) self.icon = widgetutil.make_surface(self.icon_name) self.active_icon = widgetutil.make_surface(self.icon_name + '_active')
def _set_from_info(self, guide_info): if guide_info is None: return # XXX This code is a bit ugly, because we want to use pretty defaults for # the Miro Guide, but still allow themes to override if guide_info.default and guide_info.url in _guide_url_to_title_map: self.name = _guide_url_to_title_map[guide_info.url] else: self.name = guide_info.name if guide_info.default and guide_info.url in _guide_url_to_icon_map: # one of our default guides icon_name = _guide_url_to_icon_map[guide_info.url] if icon_name != self.icon_name: self.icon_name = _guide_url_to_icon_map[guide_info.url] self.icon = widgetutil.make_surface(self.icon_name) del self.active_icon elif guide_info.faviconIsDefault: # theme guide that should use default favicon pass else: # theme guide with a favicon surface = imagepool.get_surface(guide_info.favicon) if surface.width != 23 or surface.height != 23: self.icon = imagepool.get_surface(guide_info.favicon, size=(23, 23)) else: self.icon = surface del self.active_icon
def __init__(self): widgetset.CustomSlider.__init__(self) self.set_can_focus(False) self.background_surface = widgetutil.ThreeImageSurface('playback_track') self.progress_surface = widgetutil.ThreeImageSurface('playback_track_progress') self.progress_cursor = widgetutil.make_surface('playback_cursor') self.background_surface_inactive = widgetutil.ThreeImageSurface('playback_track_inactive') self.progress_surface_inactive = widgetutil.ThreeImageSurface('playback_track_progress_inactive') self.progress_cursor_inactive = widgetutil.make_surface('playback_cursor_inactive') app.playback_manager.connect('playback-did-progress', self.handle_progress) app.playback_manager.connect('selecting-file', self.handle_selecting) app.playback_manager.connect('will-play', self.handle_play) app.playback_manager.connect('will-stop', self.handle_stop) self.disable() self.duration = 0
def __init__(self): widgetset.CustomSlider.__init__(self) self.set_can_focus(False) self.set_range(0.0, 1.0) self.set_increments(0.05, 0.20) self.track = widgetutil.ThreeImageSurface('device-slider-track') self.filled_track = widgetutil.ThreeImageSurface( 'device-slider-filled') self.knob = widgetutil.make_surface('device-slider-knob')
def __init__(self): widgetset.CustomSlider.__init__(self) # progress silders always use the range [0, 1] self.set_range(0, 1) self.set_can_focus(False) self.background_surface = widgetutil.ThreeImageSurface('playback_track') self.progress_surface = widgetutil.ThreeImageSurface('playback_track_progress') self.progress_cursor = widgetutil.make_surface('playback_cursor') self.background_surface_inactive = widgetutil.ThreeImageSurface('playback_track_inactive') self.progress_surface_inactive = widgetutil.ThreeImageSurface('playback_track_progress_inactive') self.progress_cursor_inactive = widgetutil.make_surface('playback_cursor_inactive') app.playback_manager.connect('playback-did-progress', self.handle_progress) app.playback_manager.connect('selecting-file', self.handle_selecting) app.playback_manager.connect('will-play', self.handle_play) app.playback_manager.connect('will-stop', self.handle_stop) self.disable() self.playing = False
def __init__(self): widgetset.CustomSlider.__init__(self) self.background_surface = widgetutil.ThreeImageSurface("playback_track") self.progress_surface = widgetutil.ThreeImageSurface("playback_track_progress") self.progress_cursor = widgetutil.make_surface("playback_cursor") app.playback_manager.connect("playback-did-progress", self.handle_progress) app.playback_manager.connect("selecting-file", self.handle_selecting) app.playback_manager.connect("will-play", self.handle_play) app.playback_manager.connect("will-stop", self.handle_stop) self.disable() self.duration = 0
def pack_bubbles(self, hbox, layout_manager, selected=False): if getattr(self.data, 'fake', False): return self.hbox = None if self.updating_frame > -1: return TabRenderer.pack_bubbles(self, hbox, layout_manager) if getattr(self.data, 'mount', None): eject_image = widgetutil.make_surface('icon-eject') hotspot = cellpack.Hotspot('eject-device', eject_image) alignment = cellpack.Alignment(hotspot, yalign=0.5, yscale=0.0, xalign=0.0, xscale=0.0, min_width=20) hbox.pack(alignment) self.hbox = hbox
def draw(self, context, _layout): active = self.active and "active" or "inactive" left, center, right = "left", "center", "right" # visually correct images for more than 2 options not implemented if not self.right_edge: right = center if not self.left_edge: left = center images = ( widgetutil.make_surface("toggle-button-{active}_{part}".format(active=active, part=part)) for part in (left, center, right) ) self.surface.set_images(*images) self.surface.draw(context, 0, 0, context.width)
def pack_bubbles(self, hbox, layout_manager, selected=False): if self.updating_frame > -1: image_name = 'icon-updating-%s' % self.updating_frame updating_image = widgetutil.make_surface(image_name) alignment = cellpack.Alignment( updating_image, yalign=0.5,yscale=0.0, xalign=0.0, xscale=0.0, min_width=20) hbox.pack(alignment) elif self.data.unwatched > 0: self.pack_bubble(hbox, layout_manager, self.data.unwatched, UNPLAYED_COLOR, selected=selected) if self.data.downloading > 0: self.pack_bubble(hbox, layout_manager, self.data.downloading, DOWNLOADING_COLOR, selected=selected)
def draw(self, context, _layout): active = self.active and 'active' or 'inactive' left, center, right = 'left', 'center', 'right' # visually correct images for more than 2 options not implemented if not self.right_edge: right = center if not self.left_edge: left = center images = ( widgetutil.make_surface('toggle-button-{active}_{part}'.format( active=active, part=part, )) for part in (left, center, right)) self.surface.set_images(*images) self.surface.draw(context, 0, 0, context.width)
def draw(self, context, _layout): active = self.active and 'active' or 'inactive' left, center, right = 'left', 'center', 'right' # visually correct images for more than 2 options not implemented if not self.right_edge: right = center if not self.left_edge: left = center images = (widgetutil.make_surface( 'toggle-button-{active}_{part}'.format( active=active, part=part, )) for part in (left, center, right)) self.surface.set_images(*images) self.surface.draw(context, 0, 0, context.width)
def pack_bubbles(self, hbox, layout_manager, selected=False): if self.updating_frame > -1: image_name = 'icon-updating-%s' % self.updating_frame updating_image = widgetutil.make_surface(image_name) alignment = cellpack.Alignment(updating_image, yalign=0.5, yscale=0.0, xalign=0.0, xscale=0.0, min_width=20) hbox.pack(alignment) elif self.data.unwatched > 0: self.pack_bubble(hbox, layout_manager, self.data.unwatched, UNPLAYED_COLOR, selected=selected) if self.data.downloading > 0: self.pack_bubble(hbox, layout_manager, self.data.downloading, DOWNLOADING_COLOR, selected=selected)
def __init__(self): widgetset.CustomSlider.__init__(self) self.set_range(0.0, MAX_VOLUME) self.set_increments(0.05, 0.20) self.track = widgetutil.make_surface("volume_track") self.knob = widgetutil.make_surface("volume_knob")
def __init__(self): self.unwatched = self.downloading = 0 self.icon = widgetutil.make_surface(self.icon_name) self.active_icon = widgetutil.make_surface(self.icon_name + '_active')
def __init__(self): self.unwatched = self.downloading = 0 self.icon = widgetutil.make_surface(self.icon_name)