Esempio n. 1
0
 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
Esempio n. 2
0
	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
Esempio n. 3
0
 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)
Esempio n. 4
0
	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
Esempio n. 5
0
 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
Esempio n. 6
0
	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
Esempio n. 7
0
 def iconsWidth(value):
     self.iconsWidth = parseScale(value)
Esempio n. 8
0
 def spaceIconeText(value):
     self.spaceIconeText = parseScale(value)
Esempio n. 9
0
		def itemsDistances(value):
			self.l.setItemsDistances(parseScale(value))
Esempio n. 10
0
 def satPosLeft(value):
     self.satPosLeft = parseScale(value)
Esempio n. 11
0
 def rowSplit(value):
     self.rowSplit = parseScale(value)
Esempio n. 12
0
 def treeDescription(value):
     self.treeDescription = parseScale(value)
Esempio n. 13
0
 def spaceRight(value):
     self.spaceRight = parseScale(value)
Esempio n. 14
0
 def pbarShift(value):
     self.pbarShift = parseScale(value)
Esempio n. 15
0
 def setColGap(value):
     self.colGap = parseScale(value)
Esempio n. 16
0
 def setTimeWidth(value):
     self.tw = parseScale(value)
Esempio n. 17
0
 def setIconShift(value):
     self.dy = parseScale(value)
Esempio n. 18
0
 def setIconDistance(value):
     self.iconDistance = parseScale(value)
Esempio n. 19
0
		def fieldMargins(value):
			self.fieldMargins = parseScale(value)
Esempio n. 20
0
 def trashShift(value):
     self.trashShift = parseScale(value)
Esempio n. 21
0
 def dirShift(value):
     self.dirShift = parseScale(value)
Esempio n. 22
0
 def pbarHeight(value):
     self.pbarHeight = parseScale(value)
Esempio n. 23
0
 def compactColumn(value):
     self.compactColumn = parseScale(value)
Esempio n. 24
0
 def pbarLargeWidth(value):
     self.pbarLargeWidth = parseScale(value)
Esempio n. 25
0
 def itemHeight(value):
     self.itemHeight = parseScale(value)
Esempio n. 26
0
 def partIconeShiftCompact(value):
     self.partIconeShiftCompact = parseScale(value)
Esempio n. 27
0
 def iconMargin(value):
     self.iconMargin = parseScale(value)
Esempio n. 28
0
 def partIconeShiftOriginal(value):
     self.partIconeShiftOriginal = parseScale(value)
Esempio n. 29
0
 def partIconeShiftMinimal(value):
     self.partIconeShiftMinimal = parseScale(value)
Esempio n. 30
0
		def nonplayableMargins(value):
			self.l.setNonplayableMargins(parseScale(value))