def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value)) elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected": self.l.setColor(eListboxServiceContent.eventForegroundSelected, parseColor(value)) elif attrib == "foregroundColorEventborder": self.l.setColor(eListboxServiceContent.eventborderForeground, parseColor(value)) elif attrib == "foregroundColorEventborderSelected": self.l.setColor(eListboxServiceContent.eventborderForegroundSelected, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor( eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value) ) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceNameFontName = font.family self.ServiceNameFontSize = font.pointSize elif attrib == "serviceInfoFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceInfoFontName = font.family self.ServiceInfoFontSize = font.pointSize elif attrib == "serviceNumberFont": font = parseFont(value, ((1, 1), (1, 1))) self.ServiceNumberFontName = font.family self.ServiceNumberFontSize = font.pointSize else: attribs.append((attrib, value)) self.skinAttributes = attribs self.setServiceFontsize() rc = GUIComponent.applySkin(self, desktop, parent) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def initList(self): size = self.params['size'] tabsize = self.tab_params['size'] space_width = self.params['spaceWidth'] space_height = self.params['spaceHeight'] entries_per_col = size[1] / (tabsize[1] + space_height) if (entries_per_col + 1) * (tabsize[1] + space_height) - space_height <= size[1]: entries_per_col += 1 assert entries_per_col > 0 entries_per_row = size[0] / (tabsize[0] + space_width) if (entries_per_row + 1) * (tabsize[0] + space_width) - space_width <= size[0]: entries_per_row += 1 num_rows = len(self.tabs) / entries_per_row + 1 num_pages = num_rows / entries_per_col + 1 print "entries_per_row = %d, rows = %d, num_pages = %d"%(entries_per_row, num_rows, num_pages) self.entries_per_row = entries_per_row self.entries_per_page = entries_per_col * entries_per_row self.pages = [self.tabs[i:i+self.entries_per_page] for i in range(0, len(self.tabs), self.entries_per_page)] scale = ((1,1),(1,1)) self.l.setFont(0, parseFont(self.tab_params['fontActive'], scale)) self.l.setFont(1, parseFont(self.tab_params['fontInactive'], scale)) self.l.setItemHeight(tabsize[1]+ self.params['spaceHeight']) self.buildTabPage(self.pages[0]) self.setActiveTab(0) self.instance.setContent(self.l)
def __init__(self, enableWrapAround = True): GUIComponent.__init__(self) self.screenwidth = getDesktop(0).size().width() if self.screenwidth and self.screenwidth == 1920: self.posFont = parseFont("Regular;30", ((1,1),(1,1))) self.nameFont = parseFont("Regular;30", ((1,1),(1,1))) self.itemHeight = 40 else: self.posFont = parseFont("Regular;20", ((1,1),(1,1))) self.nameFont = parseFont("Regular;20", ((1,1),(1,1))) self.itemHeight = 30 self.posColor = 0xFFFFFF self.posColorSel = 0xFFFFFF self.nameColor = 0xFFFFFF self.nameColorSel = 0xFFFFFF self.posWidth = -1 self.nameWidth = -1 self.l = eListboxPythonMultiContent() self.l.setFont(0, self.posFont) self.l.setFont(1, self.nameFont) self.onSelectionChanged = []
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "posFont": self.posFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(0, self.posFont) elif attrib == "nameFont": self.nameFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(1, self.nameFont) elif attrib == "posWidth": self.posWidth = int(value) elif attrib == "nameWidth": self.nameWidth = int(value) elif attrib == "posColor": self.posColor = parseColor(value).argb() elif attrib == "posColorSel": self.posColorSel = parseColor(value).argb() elif attrib == "nameColor": self.nameColor = parseColor(value).argb() elif attrib == "nameColorSel": self.nameColorSel = parseColor(value).argb() elif attrib == "itemHeight": self.itemHeight = int(value) else: attribs.append((attrib, value)) self.readPlaylist() self.refreshList() self.setItemHeight() self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def __init__(self): GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_s-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_c-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_dvb_t-fs8.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "ico_service_group-fs8.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1,1),(1,1))) self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1))) self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1))) self.onSelectionChanged = [ ]
def __init__(self, serviceList): self.serviceList = serviceList GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) pic and self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) pic and self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_s.png")) pic and self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_c.png")) pic and self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_dvb_t.png")) pic and self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_stream.png")) pic and self.l.setPixmap(self.l.picStream, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_service_group.png")) pic and self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/icon_crypt.png")) pic and self.l.setPixmap(self.l.picCrypto, pic) pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/record.png")) pic and self.l.setPixmap(self.l.picRecord, pic) self.root = None self.mode = self.MODE_NORMAL self.ItemHeight = 28 self.ServiceNameFont = parseFont("Regular;22", ((1,1),(1,1))) self.ServiceInfoFont = parseFont("Regular;18", ((1,1),(1,1))) self.ServiceNumberFont = parseFont("Regular;20", ((1,1),(1,1))) self.progressBarWidth = 52 self.progressPercentWidth = 0 self.fieldMargins = 10 self.onSelectionChanged = [ ]
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": self.ServiceNameFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceInfoFont": self.ServiceInfoFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceNumberFont": self.ServiceNumberFont = parseFont(value, ((1,1),(1,1))) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "EntryForegroundColor": self.foreColor = parseColor(value).argb() elif attrib == "EntryForegroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "EntryBackgroundColor": self.backColor = parseColor(value).argb() elif attrib == "EntryBackgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "EntryBorderColor": self.borderColor = parseColor(value).argb() elif attrib == "EntryFont": font = parseFont(value, ((1,1),(1,1)) ) self.entryFontName = font.family self.entryFontSize = font.pointSize elif attrib == "ServiceForegroundColor" or attrib == "ServiceNameForegroundColor": self.foreColorService = parseColor(value).argb() elif attrib == "ServiceForegroundColorSelected": self.foreColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColor" or attrib == "ServiceNameBackgroundColor": self.backColorService = parseColor(value).argb() elif attrib == "ServiceBackgroundColorSelected": self.backColorServiceSelected = parseColor(value).argb() elif attrib == "ServiceBackgroundColorRecording" or attrib == "ServiceNameBackgroundColor": self.backColorRec = parseColor(value).argb() elif attrib == "ServiceForegroundColorRecording": self.foreColorRec = parseColor(value).argb() elif attrib == "ServiceBorderColor": self.borderColorService = parseColor(value).argb() elif attrib == "ServiceFont": self.serviceFont = parseFont(value, ((1,1),(1,1)) ) elif attrib == "EntryBackgroundColorNow": self.backColorNow = parseColor(value).argb() elif attrib == "EntryForegroundColorNow": self.foreColorNow = parseColor(value).argb() elif attrib == "ServiceBorderWidth": self.serviceBorderWidth = int(value) elif attrib == "ServiceNamePadding": self.serviceNamePadding = int(value) elif attrib == "EventBorderWidth": self.eventBorderWidth = int(value) elif attrib == "EventNamePadding": self.eventNamePadding = int(value) else: attribs.append((attrib,value)) self.skinAttributes = attribs self.l.setFont(0, self.serviceFont) self.setEventFontsize() rc = GUIComponent.applySkin(self, desktop, screen) # now we know our size and can safely set items per page self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)) elif attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.serviceDescriptionColor, parseColor(value)) elif attrib == "colorServiceDescriptionSelected": self.l.setColor(eListboxServiceContent.serviceDescriptionColorSelected, parseColor(value)) elif attrib == "colorServiceRecording": self.l.setColor(eListboxServiceContent.serviceRecordingColor, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": if self.picon_width == 0: self.ItemHeight = int(value) else: if self.ItemHeight < int(value): self.ItemHeight = int(value) if config.usage.servicelist_two_lines.value and self.ItemHeight < self.min_two_line_height: self.ItemHeight = self.min_two_line_height elif attrib == "serviceNameFont": self.ServiceNameFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceInfoFont": self.ServiceInfoFont = parseFont(value, ((1,1),(1,1))) elif attrib == "serviceNumberFont": self.ServiceNumberFont = parseFont(value, ((1,1),(1,1))) elif attrib == "progressbarHeight": self.l.setProgressbarHeight(int(value)) elif attrib == "progressbarBorderWidth": self.l.setProgressbarBorderWidth(int(value)) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value)) elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected": self.l.setColor(eListboxServiceContent.eventForegroundSelected, parseColor(value)) elif attrib == "foregroundColorEventborder": self.l.setColor(eListboxServiceContent.eventborderForeground, parseColor(value)) elif attrib == "foregroundColorEventborderSelected": self.l.setColor(eListboxServiceContent.eventborderForegroundSelected, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor( eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value) ) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": self.ServiceNameFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "serviceInfoFont": self.ServiceInfoFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "serviceNumberFont": self.ServiceNumberFont = parseFont(value, ((1, 1), (1, 1))) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "font": self.l.setFont(0, parseFont(value, ((1,1),(1,1)))) elif attrib == "descriptionFont": self.descriptionFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(1, self.descriptionFont) elif attrib == "itemHeight": self.l.setItemHeight(int(value)) else: attribs.append((attrib, value)) self.skinAttributes = attribs return MenuList.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): attribs = [ ] from enigma import eSize def parseSize(str): x, y = str.split(',') return eSize(int(x), int(y)) for (attrib, value) in self.skinAttributes: if attrib == "size": self.instance.setSize(parseSize(value)) attribs.append((attrib,value)) elif attrib == "nocColor": self.nocColor = parseColor(value) elif attrib == "emmColor": self.emmColor = parseColor(value) elif attrib == "ecmColor": self.ecmColor = parseColor(value) elif attrib == "font": self.font = parseFont(value, ((1,1),(1,1))) elif attrib == "backgroundColor": self.backgroundColor = parseColor(value) self.instance.clear(self.backgroundColor) attribs.append((attrib,value)) else: attribs.append((attrib,value)) self.skinAttributes = attribs return Renderer.applySkin(self, desktop, parent)
def applySkin(self, desktop, parent): # This is a very bad way to get the skin attributes # This function is called for every skin element, we should parse the attributes depending on the element name attribs = [ ] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "font": self.listFont = parseFont(value, ((1,1),(1,1))) self.l.setFont(0, self.listFont) elif attrib == "itemHeight": self.itemHeight = int(value) self.l.setItemHeight(self.itemHeight) elif attrib == "iconPosX": self.iconPosX = int(value) elif attrib == "iconPosY": self.iconPosY = int(value) elif attrib == "iconSize": self.iconSize = int(value) elif attrib == "colWidthStb": self.colWidthStb = int(value) elif attrib == "colWidthWeb": self.colWidthWeb = int(value) elif attrib == "margin": self.margin = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs return MenuList.applySkin(self, desktop, parent)
def __init__(self, enableWrapAround = True): GUIComponent.__init__(self) self.posFont = parseFont("Regular;20", ((1,1),(1,1))) self.nameFont = parseFont("Regular;20", ((1,1),(1,1))) self.itemHeight = 30 self.posColor = 0xFFFFFF self.posColorSel = 0xFFFFFF self.nameColor = 0xFFFFFF self.nameColorSel = 0xFFFFFF self.l = eListboxPythonMultiContent() self.l.setFont(0, self.posFont) self.l.setFont(1, self.nameFont) self.onSelectionChanged = []
def applySkin(self, desktop, parent): attribs = [] from enigma import eSize def parseSize(str): x, y = str.split(",") return eSize(int(x), int(y)) for attrib, value in self.skinAttributes: if attrib == "size": self.instance.setSize(parseSize(value)) self.size = parseSize(value) attribs.append((attrib, value)) elif attrib == "backgroundColor": self.backgroundColor = parseColor(value) elif attrib == "emmColor": self.emmColor = parseColor(value) elif attrib == "ecmColor": self.ecmColor = parseColor(value) elif attrib == "font": self.font = parseFont(value, ((1, 1), (1, 1))) elif attrib == "ftaFont": self.ftaFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "foregroundColor": self.foregroundColor = parseColor(value) elif attrib == "noColor": self.noColor = parseColor(value) elif attrib == "ftaColor": self.ftaColor = parseColor(value) elif attrib == "ftaText": self.ftaText = value elif attrib == "fta": self.fta = value elif attrib == "vOffsetText": self.vOffset = value elif attrib == "bgCAIDs": self.bgCAIDs = value else: attribs.append((attrib, value)) self.skinAttributes = attribs return Renderer.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "borderColor": self.borderColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "font": self.l.setFont(0, parseFont(value, ((1,1),(1,1)) )) elif attrib == "borderWidth": self.borderWidth = int(value) elif attrib == "TimelineFont": font = parseFont(value, ((1,1),(1,1)) ) self.timelineFontName = font.family self.timelineFontSize = font.pointSize else: attribs.append((attrib,value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "font": self.l.setFont(0, parseFont(value, ((1,1),(1,1)))) elif attrib == "itemHeight": self.l.setItemHeight(int(value)) elif attrib == "colorDisabled": self.colorDisabled = parseColor(value).argb() else: attribs.append((attrib, value)) self.skinAttributes = attribs return MenuList.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "font": self.font = parseFont(value, ((1, 1), (1, 1)) ) else: attribs.append((attrib,value)) self.skinAttributes = attribs self.l.setFont(0, self.font) return GUIComponent.applySkin(self, desktop, screen)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "font": font = skin.parseFont(value, ((1,1),(1,1))) self.fontName = font.family self.fontSize = font.pointSize else: attribs.append((attrib,value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: for (attrib, value) in self.skinAttributes: if attrib == "font": self.l.setFont(0, parseFont(value, ((1,1),(1,1)))) elif attrib == "itemHeight": self.l.setItemHeight(int(value)) elif attrib == "selectedColor": self.selectedColor = int(parseColor(value)) elif attrib == "hiddenColor": self.hiddenColor = int(parseColor(value)) else: attribs.append((attrib, value)) self.skinAttributes = attribs return MenuList.applySkin(self, desktop, parent)
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "font": font = skin.parseFont(value, ((1,1),(1,1))) self.fontName = font.family self.fontSize = font.pointSize elif attrib == "itemHeight": self.ItemHeight = int(value) else: attribs.append((attrib,value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.setFontsize() self.l.setItemHeight(self.ItemHeight) return rc
def applySkin(self, desktop, parent): attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "size": self.sizeX = int(value.strip().split(",")[0]) attribs.append((attrib,value)) elif attrib == "numEvents": self.numEvents = int(value) + 1 elif attrib == "font": self.used_font = parseFont(value, ((1,1),(1,1))) attribs.append((attrib,value)) else: attribs.append((attrib,value)) self.skinAttributes = attribs self.testSizeLabel.setFont(self.used_font) self.testSizeLabel.resize(eSize(self.sizeX+500,20)) self.testSizeLabel.setVAlign(eLabel.alignTop) self.testSizeLabel.setHAlign(eLabel.alignLeft) self.testSizeLabel.setNoWrap(1) return Renderer.applySkin(self, desktop, parent)
def serviceNumberFont(value): self.ServiceNumberFont = parseFont(value, ((1,1),(1,1)))
def applySkin(self, desktop, screen): def retValue(val, limit, default, Min=False): try: if Min: x = min(limit, int(val)) else: x = max(limit, int(val)) except: x = default return x self.halign = valign = eLabel.alignLeft if self.skinAttributes: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": self.txfont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "foregroundColor": self.fcolor = parseColor(value) elif attrib == "backgroundColor": self.bcolor = parseColor(value) elif attrib == "shadowColor": self.scolor = parseColor(value) elif attrib == "shadowOffset": x, y = value.split(',') self.soffset = (int(x), int(y)) elif attrib == "valign" and value in ("top", "center", "bottom"): valign = { "top": eLabel.alignTop, "center": eLabel.alignCenter, "bottom": eLabel.alignBottom }[value] self.txtflags |= { "top": RT_VALIGN_TOP, "center": RT_VALIGN_CENTER, "bottom": RT_VALIGN_BOTTOM }[value] elif attrib == "halign" and value in ("left", "center", "right", "block"): self.halign = { "left": eLabel.alignLeft, "center": eLabel.alignCenter, "right": eLabel.alignRight, "block": eLabel.alignBlock }[value] self.txtflags |= { "left": RT_HALIGN_LEFT, "center": RT_HALIGN_CENTER, "right": RT_HALIGN_RIGHT, "block": RT_HALIGN_BLOCK }[value] elif attrib == "noWrap": if value == "0": self.txtflags |= RT_WRAP else: self.txtflags &= ~RT_WRAP elif attrib == "options": options = value.split(',') for opt in options: val = '' pos = opt.find('=') if pos != -1: val = opt[pos + 1:].strip() opt = opt[:pos].strip() if opt == "wrap": if val == "0": self.txtflags &= ~RT_WRAP else: self.txtflags |= RT_WRAP elif opt == "nowrap": if val == "0": self.txtflags |= RT_WRAP else: self.txtflags &= ~RT_WRAP elif opt == "movetype" and val in ("none", "running", "swimming"): self.type = { "none": NONE, "running": RUNNING, "swimming": SWIMMING }[val] elif opt == "direction" and val in ("left", "right", "top", "bottom"): self.direction = { "left": LEFT, "right": RIGHT, "top": TOP, "bottom": BOTTOM }[val] elif opt == "step" and val: #retValue(val, limit, default, Min=False) self.mStep = retValue(val, 1, self.mStep) elif opt == "steptime" and val: self.mStepTimeout = retValue( val, 25, self.mStepTimeout) elif opt == "startdelay" and val: self.mStartDelay = retValue( val, 0, self.mStartDelay) elif opt == "pause" and val: self.mLoopTimeout = retValue( val, 0, self.mLoopTimeout) elif opt == "oneshot" and val: self.mOneShot = retValue(val, 0, self.mOneShot) elif opt == "repeat" and val: self.mRepeat = retValue(val, 0, self.mRepeat) elif opt == "always" and val: self.mAlways = retValue(val, 0, self.mAlways) elif opt == "startpoint" and val: self.mStartPoint = int(val) else: attribs.append((attrib, value)) self.skinAttributes = attribs ret = Renderer.applySkin(self, desktop, screen) # if self.type == RUNNING and self.direction in (LEFT,RIGHT): # self.halign = eLabel.alignLeft # self.txtflags = RT_HALIGN_LEFT | (self.txtflags & RT_WRAP) if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot) if self.mLoopTimeout: self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout) self.test_label.setFont(self.txfont) # self.test_label.setForegroundColor(self.fcolor) # self.test_label.setBackgroundColor(self.bcolor) # if not self.scolor is None: # self.test_label.setShadowColor(self.scolor) # self.test_label.setShadowOffset(ePoint(self.soffset[0], self.soffset[1])) if not (self.txtflags & RT_WRAP): self.test_label.setNoWrap(1) self.test_label.setVAlign(valign) self.test_label.setHAlign(self.halign) self.test_label.move(ePoint(self.W, self.H)) self.test_label.resize(eSize(self.W, self.H)) # self.test_label.hide() # self.changed((self.CHANGED_DEFAULT,)) return ret
def setEventTimeFont(value): self.eventTimeFont = parseFont(value, ((1,1),(1,1)))
def DayNameFont(value): self.DayNameFont = parseFont(value, ((1, 1), (1, 1)))
def setServiceNameFont(value): self.serviceNameFont = parseFont(value, ((1,1),(1,1)))
def applySkin(self, desktop, screen): def retValue(val, limit, default, Min=False): try: if Min: x = min(limit, int(val)) else: x = max(limit, int(val)) except: x = default return x def setWrapFlag(attrib, value): if (attrib.lower() == "wrap" and value == "0") or \ (attrib.lower() == "nowrap" and value != "0"): self.txtflags &= ~RT_WRAP else: self.txtflags |= RT_WRAP self.halign = valign = eLabel.alignLeft if self.skinAttributes: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "font": self.txfont = parseFont(value, ((1,1),(1,1))) elif attrib == "foregroundColor": self.scroll_label.setForegroundColor(parseColor(value)) elif attrib in ("shadowColor","borderColor"): # fake for openpli-enigma2 self.scroll_label.setShadowColor(parseColor(value)) elif attrib == "shadowOffset": x, y = value.split(',') self.soffset = (int(x),int(y)) self.scroll_label.setShadowOffset(ePoint(self.soffset)) elif attrib == "borderWidth": # fake for openpli-enigma2 self.soffset = (-int(value),-int(value)) elif attrib == "valign" and value in ("top","center","bottom"): valign = { "top": eLabel.alignTop, "center": eLabel.alignCenter, "bottom": eLabel.alignBottom }[value] self.txtflags |= { "top": RT_VALIGN_TOP, "center": RT_VALIGN_CENTER, "bottom": RT_VALIGN_BOTTOM }[value] elif attrib == "halign" and value in ("left","center","right","block"): self.halign = { "left": eLabel.alignLeft, "center": eLabel.alignCenter, "right": eLabel.alignRight, "block": eLabel.alignBlock }[value] self.txtflags |= { "left": RT_HALIGN_LEFT, "center": RT_HALIGN_CENTER, "right": RT_HALIGN_RIGHT, "block": RT_HALIGN_BLOCK }[value] elif attrib == "noWrap": setWrapFlag(attrib, value) elif attrib == "options": options = value.split(',') for o in options: if o.find('=') != -1: opt, val = (x.strip() for x in o.split('=', 1)) else: opt, val = o.strip(), "" if opt == "": continue elif opt in ("wrap", "nowrap"): setWrapFlag(opt, val) elif opt == "movetype" and val in ("none","running","swimming"): self.type = {"none": NONE, "running": RUNNING, "swimming": SWIMMING}[val] elif opt =="direction" and val in ("left","right","top","bottom"): self.direction = { "left": LEFT, "right": RIGHT, "top": TOP, "bottom": BOTTOM }[val] elif opt == "step" and val: self.mStep = retValue(val, 1, self.mStep) elif opt == "steptime" and val: self.mStepTimeout = retValue(val, 25, self.mStepTimeout) elif opt == "startdelay" and val: self.mStartDelay = retValue(val, 0, self.mStartDelay) elif opt == "pause" and val: self.mLoopTimeout = retValue(val, 0, self.mLoopTimeout) elif opt == "oneshot" and val: self.mOneShot = retValue(val, 0, self.mOneShot) elif opt =="repeat" and val: self.mRepeat = retValue(val, 0, self.mRepeat) elif opt =="always" and val: self.mAlways = retValue(val, 0, self.mAlways) elif opt =="startpoint" and val: self.mStartPoint = int(val) elif opt == "pagedelay" and val: self.mPageDelay = retValue(val, 0, self.mPageDelay) elif opt == "pagelength" and val: self.mPageLength = retValue(val, 0, self.mPageLength) else: attribs.append((attrib,value)) if attrib == "backgroundColor": self.scroll_label.setBackgroundColor(parseColor(value)) elif attrib == "transparent": self.scroll_label.setTransparent(int(value)) self.skinAttributes = attribs ret = Renderer.applySkin(self, desktop, screen) if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot) if self.mLoopTimeout: self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout) if self.mPageDelay: self.mPageDelay = max(self.mStepTimeout, self.mPageDelay) self.scroll_label.setFont(self.txfont) if not (self.txtflags & RT_WRAP): self.scroll_label.setNoWrap(1) self.scroll_label.setVAlign(valign) self.scroll_label.setHAlign(self.halign) self.scroll_label.move( ePoint(0,0) ) self.scroll_label.resize( eSize(self.W,self.H) ) # test for auto correction text height: if self.direction in (TOP,BOTTOM): from enigma import fontRenderClass flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont) or self.txfont.pointSize/6 + self.txfont.pointSize) self.scroll_label.setText("WQq") if flh > self.scroll_label.calculateSize().height(): self.lineHeight = flh self.scroll_label.setText("") return ret
def EventNameFont(value): self.EventNameFont = parseFont(value, ((1, 1), (1, 1)))
def setServiceNameFont(value): self.serviceNameFont = parseFont(value, ((1, 1), (1, 1)))
def setFont(value): self.font = parseFont(value, ((1, 1), (1, 1)))
def serviceNumberFont(value): font = parseFont(value, ((1, 1), (1, 1))) self.ServiceNumberFontName = font.family self.ServiceNumberFontSize = font.pointSize
def applySkin(self, desktop, screen): def retValue(val, limit, default, Min=False): try: if Min: x = min(limit, int(val)) else: x = max(limit, int(val)) except: x = default return x def setWrapFlag(attrib, value): if attrib.lower() == 'wrap' and value == '0' or attrib.lower( ) == 'nowrap' and value != '0': self.txtflags &= ~RT_WRAP else: self.txtflags |= RT_WRAP self.halign = valign = eLabel.alignLeft if self.skinAttributes: attribs = [] for attrib, value in self.skinAttributes: if attrib == 'font': self.txfont = parseFont(value, ((1, 1), (1, 1))) elif attrib == 'foregroundColor': self.scroll_label.setForegroundColor(parseColor(value)) elif attrib in ('shadowColor', 'borderColor'): self.scroll_label.setShadowColor(parseColor(value)) elif attrib == 'shadowOffset': x, y = value.split(',') self.soffset = (int(x), int(y)) self.scroll_label.setShadowOffset(ePoint(self.soffset)) elif attrib == 'borderWidth': self.soffset = (-int(value), -int(value)) elif attrib == 'valign' and value in ('top', 'center', 'bottom'): valign = { 'top': eLabel.alignTop, 'center': eLabel.alignCenter, 'bottom': eLabel.alignBottom }[value] self.txtflags |= { 'top': RT_VALIGN_TOP, 'center': RT_VALIGN_CENTER, 'bottom': RT_VALIGN_BOTTOM }[value] elif attrib == 'halign' and value in ('left', 'center', 'right', 'block'): self.halign = { 'left': eLabel.alignLeft, 'center': eLabel.alignCenter, 'right': eLabel.alignRight, 'block': eLabel.alignBlock }[value] self.txtflags |= { 'left': RT_HALIGN_LEFT, 'center': RT_HALIGN_CENTER, 'right': RT_HALIGN_RIGHT, 'block': RT_HALIGN_BLOCK }[value] elif attrib == 'noWrap': setWrapFlag(attrib, value) elif attrib == 'options': options = value.split(',') for o in options: if o.find('=') != -1: opt, val = (x.strip() for x in o.split('=', 1)) else: opt, val = o.strip(), '' if opt == '': continue elif opt in ('wrap', 'nowrap'): setWrapFlag(opt, val) elif opt == 'movetype' and val in ('none', 'running', 'swimming'): self.type = { 'none': NONE, 'running': RUNNING, 'swimming': SWIMMING }[val] elif opt == 'direction' and val in ('left', 'right', 'top', 'bottom'): self.direction = { 'left': LEFT, 'right': RIGHT, 'top': TOP, 'bottom': BOTTOM }[val] elif opt == 'step' and val: self.mStep = retValue(val, 1, self.mStep) elif opt == 'steptime' and val: self.mStepTimeout = retValue( val, 25, self.mStepTimeout) elif opt == 'startdelay' and val: self.mStartDelay = retValue( val, 0, self.mStartDelay) elif opt == 'pause' and val: self.mLoopTimeout = retValue( val, 0, self.mLoopTimeout) elif opt == 'oneshot' and val: self.mOneShot = retValue(val, 0, self.mOneShot) elif opt == 'repeat' and val: self.mRepeat = retValue(val, 0, self.mRepeat) elif opt == 'always' and val: self.mAlways = retValue(val, 0, self.mAlways) elif opt == 'startpoint' and val: self.mStartPoint = int(val) elif opt == 'pagedelay' and val: self.mPageDelay = retValue(val, 0, self.mPageDelay) elif opt == 'pagelength' and val: self.mPageLength = retValue( val, 0, self.mPageLength) else: attribs.append((attrib, value)) if attrib == 'backgroundColor': self.scroll_label.setBackgroundColor(parseColor(value)) elif attrib == 'transparent': self.scroll_label.setTransparent(int(value)) self.skinAttributes = attribs ret = Renderer.applySkin(self, desktop, screen) if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot) if self.mLoopTimeout: self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout) if self.mPageDelay: self.mPageDelay = max(self.mStepTimeout, self.mPageDelay) self.scroll_label.setFont(self.txfont) if not self.txtflags & RT_WRAP: self.scroll_label.setNoWrap(1) self.scroll_label.setVAlign(valign) self.scroll_label.setHAlign(self.halign) self.scroll_label.move(ePoint(0, 0)) self.scroll_label.resize(eSize(self.W, self.H)) if self.direction in (TOP, BOTTOM): from enigma import fontRenderClass flh = int(fontRenderClass.getInstance().getLineHeight(self.txfont) or self.txfont.pointSize / 6 + self.txfont.pointSize) self.scroll_label.setText('WQq') if flh > self.scroll_label.calculateSize().height(): self.lineHeight = flh self.scroll_label.setText('') return ret
def serviceInfoFont(value): self.ServiceInfoFont = parseFont(value, ((1,1),(1,1)))
def font(value): font = parseFont(value, ((1,1),(1,1))) self.fontName = font.family self.fontSize = font.pointSize
def progressInfoFont(value): font = parseFont(value, ((1, 1), (1, 1))) self.progressInfoFontName = font.family self.progressInfoFontSize = font.pointSize
def applySkin(self, desktop, parent): attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.markedForeground = parseColor(value) elif attrib == "foregroundColorMarkedSelected": self.markedForegroundSelected = parseColor(value) elif attrib == "backgroundColorMarked": self.markedBackground = parseColor(value) elif attrib == "backgroundColorMarkedSelected": self.markedBackgroundSelected = parseColor(value) elif attrib == "foregroundColorServiceNotAvail": self.serviceNotAvail = parseColor(value) elif attrib == "colorEventProgressbar": self.serviceEventProgressbarColor = parseColor(value) elif attrib == "colorEventProgressbarSelected": self.serviceEventProgressbarColorSelected = parseColor(value) elif attrib == "forgroundColorEventProgressbarBorder": self.serviceEventProgressbarBackColor = parseColor(value) elif attrib == "backgroundColorEventProgressbarBorderSelected": self.serviceEventProgressbarBackColorSelected = parseColor( value) elif attrib == "colorEventProgressbarBorder": self.serviceEventProgressbarBorderColor = parseColor(value) elif attrib == "colorEventProgressbarBorderSelected": self.serviceEventProgressbarBorderColorSelected = parseColor( value) elif attrib == "colorServiceDescription": self.serviceDescriptionColor = parseColor(value) elif attrib == "colorServiceDescriptionSelected": self.serviceDescriptionColorSelected = parseColor(value) elif attrib == "colorRecording": self.recordingColor = parseColor(value) elif attrib == "colorRecordingSelected": self.recordingColorSelected = parseColor(value) elif attrib == "colorAdditionalInfo": self.additionalInfoColor = parseColor(value) elif attrib == "colorAdditionalInfoSelected": self.additionalInfoColorSelected = parseColor(value) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.picServiceEventProgressbar = pic elif attrib == "serviceItemHeight": self.itemHeight = int(value) elif attrib == "serviceItemHeightHigh": self.itemHeightHigh = int(value) elif attrib == "serviceNameFont": self.l.setFont(2, parseFont(value, ((1, 1), (1, 1)))) self.serviceNameFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "serviceInfoFont": self.l.setFont(3, parseFont(value, ((1, 1), (1, 1)))) name, size = value.split(';') self.serviceInfoFontHeight = int(size) elif attrib == "serviceNumberFont": self.l.setFont(1, parseFont(value, ((1, 1), (1, 1)))) elif attrib == "additionalInfoFont": self.l.setFont(0, parseFont(value, ((1, 1), (1, 1)))) self.additionalInfoFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "selectionPixmap": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.selectionPixmapStandard = pic if not config.usage.configselection_bigpicons.value: self.instance.setSelectionPicture( self.selectionPixmapStandard) elif attrib == "selectionPixmapHigh": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.selectionPixmapBig = pic if config.usage.configselection_bigpicons.value: self.instance.setSelectionPicture( self.selectionPixmapBig) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def serviceNumberFont(value): font = parseFont(value, ((1,1),(1,1)) ) self.ServiceNumberFontName = font.family self.ServiceNumberFontSize = font.pointSize
def applySkin(self, desktop, parent): attribs = [ ] if self.skinAttributes is not None: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor(eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "foregroundColorEvent" or attrib == "colorServiceDescription": self.l.setColor(eListboxServiceContent.eventForeground, parseColor(value)) elif attrib == "foregroundColorEventSelected" or attrib == "colorServiceDescriptionSelected": self.l.setColor(eListboxServiceContent.eventForegroundSelected, parseColor(value)) elif attrib == "foregroundColorEventborder": self.l.setColor(eListboxServiceContent.eventborderForeground, parseColor(value)) elif attrib == "foregroundColorEventborderSelected": self.l.setColor(eListboxServiceContent.eventborderForegroundSelected, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorServiceRecorded": self.l.setColor(eListboxServiceContent.serviceRecorded, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor(eListboxServiceContent.serviceEventProgressbarBorderColorSelected, parseColor(value)) elif attrib == "colorServiceRecorded": self.l.setColor(eListboxServiceContent.serviceRecorded, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_ACTIVE_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": font = parseFont(value, ((1,1),(1,1)) ) self.ServiceNameFontName = font.family self.ServiceNameFontSize = font.pointSize elif attrib == "serviceInfoFont": font = parseFont(value, ((1,1),(1,1)) ) self.ServiceInfoFontName = font.family self.ServiceInfoFontSize = font.pointSize elif attrib == "serviceNumberFont": font = parseFont(value, ((1,1),(1,1)) ) self.ServiceNumberFontName = font.family self.ServiceNumberFontSize = font.pointSize elif attrib == "progressbarHeight": self.l.setProgressbarHeight(int(value)) elif attrib == "progressbarBorderWidth": self.l.setProgressbarBorderWidth(int(value)) else: attribs.append((attrib, value)) self.skinAttributes = attribs self.setServiceFontsize() rc = GUIComponent.applySkin(self, desktop, parent) self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setItemsPerPage() return rc
def ServiceNameFont(value): self.ServiceNameFont = parseFont(value, ((1, 1), (1, 1)))
def setFont(value): self.font = parseFont(value, ((1,1),(1,1)))
def applySkin(self, desktop, screen): def retValue(val, limit, default, Min=False): try: if Min: x = min(limit, int(val)) else: x = max(limit, int(val)) except: x = default return x self.halign = valign = eLabel.alignLeft if self.skinAttributes: attribs = [ ] for (attrib, value) in self.skinAttributes: if attrib == "font": self.txfont = parseFont(value, ((1,1),(1,1))) elif attrib == "foregroundColor": self.fcolor = parseColor(value) elif attrib == "backgroundColor": self.bcolor = parseColor(value) elif attrib == "shadowColor": self.scolor = parseColor(value) elif attrib == "shadowOffset": x, y = value.split(',') self.soffset = (int(x),int(y)) elif attrib == "valign" and value in ("top","center","bottom"): valign = { "top": eLabel.alignTop, "center": eLabel.alignCenter, "bottom": eLabel.alignBottom }[value] self.txtflags |= { "top": RT_VALIGN_TOP, "center": RT_VALIGN_CENTER, "bottom": RT_VALIGN_BOTTOM }[value] elif attrib == "halign" and value in ("left","center","right","block"): self.halign = { "left": eLabel.alignLeft, "center": eLabel.alignCenter, "right": eLabel.alignRight, "block": eLabel.alignBlock }[value] self.txtflags |= { "left": RT_HALIGN_LEFT, "center": RT_HALIGN_CENTER, "right": RT_HALIGN_RIGHT, "block": RT_HALIGN_BLOCK }[value] elif attrib == "noWrap": if value == "0": self.txtflags |= RT_WRAP else: self.txtflags &= ~RT_WRAP elif attrib == "options": options = value.split(',') for opt in options: val = '' pos = opt.find('=') if pos != -1: val = opt[pos+1:].strip() opt = opt[:pos].strip() if opt == "wrap": if val == "0": self.txtflags &= ~RT_WRAP else: self.txtflags |= RT_WRAP elif opt == "nowrap": if val == "0": self.txtflags |= RT_WRAP else: self.txtflags &= ~RT_WRAP elif opt == "movetype" and val in ("none","running","swimming"): self.type = {"none": NONE, "running": RUNNING, "swimming": SWIMMING}[val] elif opt =="direction" and val in ("left","right","top","bottom"): self.direction = { "left": LEFT, "right": RIGHT, "top": TOP, "bottom": BOTTOM }[val] elif opt == "step" and val: #retValue(val, limit, default, Min=False) self.mStep = retValue(val, 1, self.mStep) elif opt == "steptime" and val: self.mStepTimeout = retValue(val, 25, self.mStepTimeout) elif opt == "startdelay" and val: self.mStartDelay = retValue(val, 0, self.mStartDelay) elif opt == "pause" and val: self.mLoopTimeout = retValue(val, 0, self.mLoopTimeout) elif opt == "oneshot" and val: self.mOneShot = retValue(val, 0, self.mOneShot) elif opt =="repeat" and val: self.mRepeat = retValue(val, 0, self.mRepeat) elif opt =="always" and val: self.mAlways = retValue(val, 0, self.mAlways) elif opt =="startpoint" and val: self.mStartPoint = int(val) else: attribs.append((attrib,value)) self.skinAttributes = attribs ret = Renderer.applySkin(self, desktop, screen) #if self.type == RUNNING and self.direction in (LEFT,RIGHT): # self.halign = eLabel.alignLeft # self.txtflags = RT_HALIGN_LEFT | (self.txtflags & RT_WRAP) if self.mOneShot: self.mOneShot = max(self.mStepTimeout, self.mOneShot) if self.mLoopTimeout: self.mLoopTimeout = max(self.mStepTimeout, self.mLoopTimeout) self.test_label.setFont(self.txfont) #self.test_label.setForegroundColor(self.fcolor) #self.test_label.setBackgroundColor(self.bcolor) #if not self.scolor is None: # self.test_label.setShadowColor(self.scolor) # self.test_label.setShadowOffset(ePoint(self.soffset[0], self.soffset[1])) if not (self.txtflags & RT_WRAP): self.test_label.setNoWrap(1) self.test_label.setVAlign(valign) self.test_label.setHAlign(self.halign) self.test_label.move( ePoint(self.W,self.H) ) self.test_label.resize( eSize(self.W,self.H) ) #self.test_label.hide() #self.changed((self.CHANGED_DEFAULT,)) return ret
def font1(value): self.font1 = parseFont(value, ((1,1),(1,1)))
def applySkin(self, desktop, parent): attribs = [] if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "foregroundColorMarked": self.l.setColor(eListboxServiceContent.markedForeground, parseColor(value)) elif attrib == "foregroundColorMarkedSelected": self.l.setColor( eListboxServiceContent.markedForegroundSelected, parseColor(value)) elif attrib == "backgroundColorMarked": self.l.setColor(eListboxServiceContent.markedBackground, parseColor(value)) elif attrib == "backgroundColorMarkedSelected": self.l.setColor( eListboxServiceContent.markedBackgroundSelected, parseColor(value)) elif attrib == "foregroundColorServiceNotAvail": self.l.setColor(eListboxServiceContent.serviceNotAvail, parseColor(value)) elif attrib == "colorEventProgressbar": self.l.setColor( eListboxServiceContent.serviceEventProgressbarColor, parseColor(value)) elif attrib == "colorEventProgressbarSelected": self.l.setColor( eListboxServiceContent. serviceEventProgressbarColorSelected, parseColor(value)) elif attrib == "colorEventProgressbarBorder": self.l.setColor( eListboxServiceContent. serviceEventProgressbarBorderColor, parseColor(value)) elif attrib == "colorEventProgressbarBorderSelected": self.l.setColor( eListboxServiceContent. serviceEventProgressbarBorderColorSelected, parseColor(value)) elif attrib == "colorServiceDescription": self.l.setColor( eListboxServiceContent.serviceDescriptionColor, parseColor(value)) elif attrib == "colorServiceDescriptionSelected": self.l.setColor( eListboxServiceContent.serviceDescriptionColorSelected, parseColor(value)) elif attrib == "picServiceEventProgressbar": pic = LoadPixmap(resolveFilename(SCOPE_CURRENT_SKIN, value)) if pic: self.l.setPixmap(self.l.picServiceEventProgressbar, pic) elif attrib == "serviceItemHeight": self.ItemHeight = int(value) elif attrib == "serviceNameFont": self.ServiceNameFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "serviceInfoFont": self.ServiceInfoFont = parseFont(value, ((1, 1), (1, 1))) elif attrib == "serviceNumberFont": self.ServiceNumberFont = parseFont(value, ((1, 1), (1, 1))) else: attribs.append((attrib, value)) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, parent)
def font0(value): self.font0 = parseFont(value, ((1,1),(1,1)))
def __init__(self): GUIComponent.__init__(self) self.l = eListboxServiceContent() pic = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/folder.png")) if pic: self.l.setPixmap(self.l.picFolder, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/marker.png")) if pic: self.l.setPixmap(self.l.picMarker, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/icon_dvb_s.png")) if pic: self.l.setPixmap(self.l.picDVB_S, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/icon_dvb_c.png")) if pic: self.l.setPixmap(self.l.picDVB_C, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/icon_dvb_t.png")) if pic: self.l.setPixmap(self.l.picDVB_T, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/ico_service_group-fs8.png")) if pic: self.l.setPixmap(self.l.picServiceGroup, pic) pic = LoadPixmap( resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/icons/epgclock.png")) if pic: self.l.setPixmap(self.l.picRecordService, pic) if config.usage.servicelist_show_picon.value: self.l.setPiconFunction(findPicon) if config.usage.servicelist_mark_rec_service: self.l.setRECServiceFunction(recordService) self.picon_width = int(config.usage.servicelist_show_picon.value) self.custom_picon_width, self.custom_picon_height = skin.parameters.get( "ServicelistCustomPiconSize", (50, 30)) self.root = None self.mode = self.MODE_NORMAL self.min_two_line_height = int( skin.parameters.get("ServicelistDoubleSpacedMinHeight", (50, ))[0]) if self.picon_width == 100: self.ItemHeight = 60 p_w = 100 p_h = 60 elif self.picon_width == 50: self.ItemHeight = 30 p_w = 50 p_h = 30 elif self.picon_width == 1: self.ItemHeight = self.custom_picon_height p_w = self.custom_picon_width p_h = self.custom_picon_height else: self.ItemHeight = 30 if config.usage.servicelist_two_lines.value and self.ItemHeight < self.min_two_line_height: self.ItemHeight = self.min_two_line_height if self.picon_width > 0: self.l.setPiconHeight(int(p_h)) self.l.setPiconWidth(int(p_w)) self.ServiceNameFont = parseFont("Regular;22", ((1, 1), (1, 1))) self.ServiceInfoFont = parseFont("Regular;18", ((1, 1), (1, 1))) self.ServiceNumberFont = parseFont("Regular;20", ((1, 1), (1, 1))) self.onSelectionChanged = []
def setEventItemFont(value): self.eventItemFont = parseFont(value, ((1, 1), (1, 1)))