def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": font = parseFont(value, ((1, 1), (1, 1))) self.bouquetFontName = font.family self.bouquetFontSize = font.pointSize elif attrib == "foregroundColor": self.foreColor = parseColor(value).argb() elif attrib == "backgroundColor": self.backColor = parseColor(value).argb() elif attrib == "foregroundColorSelected": self.foreColorSelected = parseColor(value).argb() elif attrib == "backgroundColorSelected": self.backColorSelected = parseColor(value).argb() elif attrib == "borderColor": self.borderColor = parseColor(value).argb() elif attrib == "borderWidth": self.borderWidth = parseScale(value) elif attrib == "itemHeight": self.itemHeight = parseScale(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.setFontsize() self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.l.setItemHeight(self.itemHeight) return rc
def applySkin(self, desktop, parent): scrollbarWidth = 20 scrollbarBorderWidth = 1 ret = False if self.skinAttributes: widget_attribs = [] scrollbar_attribs = [] scrollbarAttrib = ["borderColor", "borderWidth", "scrollbarSliderForegroundColor", "scrollbarSliderBorderColor"] for (attrib, value) in self.skinAttributes[:]: if attrib in scrollbarAttrib: scrollbar_attribs.append((attrib, value)) self.skinAttributes.remove((attrib, value)) elif attrib in ("scrollbarSliderPicture", "sliderPixmap"): self.scrollbar.setPixmap(skin.loadPixmap(value, desktop)) self.skinAttributes.remove((attrib, value)) elif attrib in ("scrollbarBackgroundPicture", "scrollbarbackgroundPixmap"): self.scrollbar.setBackgroundPixmap(skin.loadPixmap(value, desktop)) self.skinAttributes.remove((attrib, value)) elif "transparent" in attrib or "backgroundColor" in attrib: widget_attribs.append((attrib, value)) elif "scrollbarWidth" in attrib: scrollbarWidth = skin.parseScale(value) self.skinAttributes.remove((attrib, value)) elif "scrollbarSliderBorderWidth" in attrib: scrollbarBorderWidth = skin.parseScale(value) self.skinAttributes.remove((attrib, value)) elif "split" in attrib: self.split = 1 if value.lower() in ("1", "enabled", "on", "split", "true", "yes") else 0 if self.split: self.right_text = eLabel(self.instance) self.skinAttributes.remove((attrib, value)) elif "colposition" in attrib: self.column = skin.parseScale(value) elif "dividechar" in attrib: self.splitchar = value if self.split: skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes + [("halign", "left")], parent.scale) skin.applyAllAttributes(self.right_text, desktop, self.skinAttributes + [("transparent", "1"), ("halign", "left" if self.column else "right")], parent.scale) else: skin.applyAllAttributes(self.long_text, desktop, self.skinAttributes, parent.scale) skin.applyAllAttributes(self.instance, desktop, widget_attribs, parent.scale) skin.applyAllAttributes(self.scrollbar, desktop, scrollbar_attribs + widget_attribs, parent.scale) ret = True self.pageWidth = self.long_text.size().width() lineheight = fontRenderClass.getInstance().getLineHeight(self.long_text.getFont()) or 30 # assume a random lineheight if nothing is visible lines = int(self.long_text.size().height() / lineheight) self.pageHeight = int(lines * lineheight) self.instance.move(self.long_text.position()) self.instance.resize(eSize(self.pageWidth, self.pageHeight + int(lineheight/6))) self.scrollbar.move(ePoint(self.pageWidth - scrollbarWidth, 0)) self.scrollbar.resize(eSize(scrollbarWidth, self.pageHeight + int(lineheight / 6))) self.scrollbar.setOrientation(eSlider.orVertical) self.scrollbar.setRange(0, 100) self.scrollbar.setBorderWidth(scrollbarBorderWidth) self.setText(self.message) return ret
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "rowsincolumn": self.rows_in_column = parseScale(value) self.skinAttributes = attribs return GUIComponent.applySkin(self, desktop, screen)
def getListItemHeight(self): defaultItemHeight = 25 # if no itemHeight is present in the skin if self.list and hasattr(self["list"], "skinAttributes") and isinstance(self["list"].skinAttributes, list): for (attrib, value) in self["list"].skinAttributes: if attrib == "itemHeight": itemHeight = parseScale(value) # if value does not parse (due to bad syntax in skin), itemHeight will be 0 return itemHeight if itemHeight else defaultItemHeight return defaultItemHeight # if itemHeight not in skinAttributes
def applySkin(self, desktop, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "font": font = parseFont(value, ((1, 1), (1, 1))) self.fontName = font.family self.fontSize = font.pointSize elif attrib == "itemHeight": self.ItemHeight = parseScale(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, screen): if self.skinAttributes is not None: attribs = [] for (attrib, value) in self.skinAttributes: if attrib == "itemHeight": self.skinItemHeight = parseScale(value) elif attrib == "NumberOfRows": # for compatibility with ATV skins self.numberOfRows = int(value) else: attribs.append((attrib, value)) self.skinAttributes = attribs rc = GUIComponent.applySkin(self, desktop, screen) self.skinListHeight = self.listHeight = self.instance.size().height() self.listWidth = self.instance.size().width() self.setFontsize() self.setItemsPerPage() return rc
def iconsWidth(value): self.iconsWidth = parseScale(value)
def spaceIconeText(value): self.spaceIconeText = parseScale(value)
def itemsDistances(value): self.l.setItemsDistances(parseScale(value))
def satPosLeft(value): self.satPosLeft = parseScale(value)
def rowSplit(value): self.rowSplit = parseScale(value)
def treeDescription(value): self.treeDescription = parseScale(value)
def spaceRight(value): self.spaceRight = parseScale(value)
def pbarShift(value): self.pbarShift = parseScale(value)
def setColGap(value): self.colGap = parseScale(value)
def setTimeWidth(value): self.tw = parseScale(value)
def setIconShift(value): self.dy = parseScale(value)
def setIconDistance(value): self.iconDistance = parseScale(value)
def fieldMargins(value): self.fieldMargins = parseScale(value)
def trashShift(value): self.trashShift = parseScale(value)
def dirShift(value): self.dirShift = parseScale(value)
def pbarHeight(value): self.pbarHeight = parseScale(value)
def compactColumn(value): self.compactColumn = parseScale(value)
def pbarLargeWidth(value): self.pbarLargeWidth = parseScale(value)
def itemHeight(value): self.itemHeight = parseScale(value)
def partIconeShiftCompact(value): self.partIconeShiftCompact = parseScale(value)
def iconMargin(value): self.iconMargin = parseScale(value)
def partIconeShiftOriginal(value): self.partIconeShiftOriginal = parseScale(value)
def partIconeShiftMinimal(value): self.partIconeShiftMinimal = parseScale(value)
def nonplayableMargins(value): self.l.setNonplayableMargins(parseScale(value))