Skip to content

Commit

Permalink
[Scrolllabel]
Browse files Browse the repository at this point in the history
* improve default skin attributes
  • Loading branch information
jbleyel committed Oct 2, 2023
1 parent dd76d30 commit 1cdfc11
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions lib/python/Components/ScrollLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,15 @@ def GUIdelete(self):
self.instance = None

def applySkin(self, desktop, parent):
scrollLabelDefaults = (
("scrollbarBorderWidth", eListbox.DefaultScrollBarBorderWidth),
("scrollbarMode", eListbox.showOnDemand),
("scrollbarOffset", eListbox.DefaultScrollBarOffset),
("scrollbarScroll", eListbox.DefaultScrollBarScroll),
("scrollbarWidth", eListbox.DefaultScrollBarWidth)
)
for attribute, default in scrollLabelDefaults:
if attribute not in scrollLabelStyle:
scrollLabelStyle[attribute] = default
splitMargin = 0
splitPosition = 0
splitSeparated = False
sliderBorderWidth = scrollLabelStyle["scrollbarBorderWidth"]
sliderMode = scrollLabelStyle["scrollbarMode"]
sliderScroll = scrollLabelStyle["scrollbarScroll"]
sliderOffset = scrollLabelStyle["scrollbarOffset"]
sliderWidth = scrollLabelStyle["scrollbarWidth"]
scrollbarRadius = scrollLabelStyle["scrollbarRadius"]
sliderBorderWidth = scrollLabelStyle.get("scrollbarBorderWidth", eListbox.DefaultScrollBarBorderWidth)
sliderMode = scrollLabelStyle.get("scrollbarMode", eListbox.showOnDemand)
sliderScroll = scrollLabelStyle.get("scrollbarScroll", eListbox.DefaultScrollBarScroll)
sliderOffset = scrollLabelStyle.get("scrollbarOffset", eListbox.DefaultScrollBarOffset)
sliderWidth = scrollLabelStyle.get("scrollbarWidth", eListbox.DefaultScrollBarWidth)
scrollbarRadius = scrollLabelStyle.get("scrollbarRadius", None)
scrollbarGradient = None
noWrap = False
if self.skinAttributes:
Expand Down Expand Up @@ -159,7 +149,8 @@ def applySkin(self, desktop, parent):
self.slider.setOrientation(eSlider.orVertical)
self.slider.setRange(0, 1000)
self.slider.setBorderWidth(sliderBorderWidth)
self.slider.setCornerRadius(*scrollbarRadius)
if scrollbarRadius:
self.slider.setCornerRadius(*scrollbarRadius)
if scrollbarGradient:
scrollbarGradient = scrollbarGradient + (True,) # Add fullColor
self.slider.setForegroundGradient(*scrollbarGradient)
Expand Down

1 comment on commit 1cdfc11

@urie57
Copy link

@urie57 urie57 commented on 1cdfc11 Oct 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this new commit no bootloop now on dev build when using kiddac skins

Please sign in to comment.