Skip to content

Commit

Permalink
Merge pull request #2953 from openatv/IanSav-Skin-1
Browse files Browse the repository at this point in the history
[skin.py] Small corrections and adjustments
  • Loading branch information
jbleyel committed Jun 20, 2023
2 parents 315b05c + 98d9e8d commit e0d7017
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def parseGradient(value):
"vertical": ePixmap.GRADIENT_VERTICAL,
}
direction = parseOptions(options, "gradient", data[2], ePixmap.GRADIENT_VERTICAL)
if len(data) == 3:
alphaBend = BT_ALPHABLEND if data[3] == '1' else 0
if len(data) == 4:
alphaBend = BT_ALPHABLEND if parseBoolean("1", data[3]) else 0
return (parseColor(data[0], default=0x00000000), parseColor(data[1], 0x00FFFFFF), direction, alphaBend)
else:
skinError("The gradient '%s' must be 'startColor,endColor,direction[,blend]', using '#00000000,#00FFFFFF,vertical' (Black,White,vertical)" % value)
Expand Down Expand Up @@ -772,8 +772,8 @@ def backgroundColorSelected(self, value):
def setBackgroundGradient(self, value):
self.guiObject.setBackgroundGradient(*parseGradient(value))

def setBackgroundGradientSeleced(self, value):
self.guiObject.setBackgroundGradientSeleced(*parseGradient(value))
def setBackgroundGradientSelected(self, value):
self.guiObject.setBackgroundGradientSelected(*parseGradient(value))

def backgroundCrypted(self, value):
self.guiObject.setBackgroundColor(parseColor(value, 0x00000000))
Expand Down Expand Up @@ -861,7 +861,7 @@ def itemHeight(self, value):
self.guiObject.setItemHeight(self.applyVerticalScale(value))

def itemSpacing(self, value):
if len(value.split(",")) == 1:
if len(value.split(",")) == 1: # These values will be stripped in parseCoordinate().
value = "%s,%s" % (value, value)
self.guiObject.setItemSpacing(parsePosition(value, self.scaleTuple, self.guiObject, self.desktop))

Expand Down Expand Up @@ -997,11 +997,10 @@ def selectionPixmap(self, value):
self.guiObject.setSelectionPixmap(parsePixmap(value, self.desktop))

def selectionZoom(self, value):
try:
value = float(value)
except ValueError:
value = 1.0
self.guiObject.setSelectionZoom(value)
value = parseInteger(value, 0)
if value > 500:
value = 500
self.guiObject.setSelectionZoom(float("%d.%s" % ((value // 100) + 1, value % 100)))

def shadowColor(self, value):
self.guiObject.setShadowColor(parseColor(value, 0x00000000))
Expand Down

0 comments on commit e0d7017

Please sign in to comment.