mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 10:18:51 +01:00
change brightness range
This commit is contained in:
parent
eb41762639
commit
3f46361814
@ -103,6 +103,9 @@ class BrightnessPage(Page):
|
||||
_MySlider = None
|
||||
_FootMsg = ["Nav","","","Back","Enter"]
|
||||
|
||||
_Max = 8
|
||||
_Min = 0
|
||||
|
||||
def Init(self):
|
||||
self._CanvasHWND = self._Screen._CanvasHWND
|
||||
self._Width = self._Screen._Width
|
||||
@ -144,20 +147,17 @@ class BrightnessPage(Page):
|
||||
try:
|
||||
f = open(BackLight,'w')
|
||||
except IOError:
|
||||
print("Open write %s failed" % BackLight)
|
||||
print("Open write %s failed %d" % (BackLight,newbrt+1))
|
||||
return False
|
||||
else:
|
||||
with f:
|
||||
f.write(str(newbrt))
|
||||
return True
|
||||
|
||||
def WhenSliderDrag(self,value): ##value 0-100
|
||||
if value < 0 or value > 8:
|
||||
def WhenSliderDrag(self,value): ##value
|
||||
if value < self._Min or value > self._Max:
|
||||
return
|
||||
|
||||
if value == 0: ## 0 == total black
|
||||
value = 1
|
||||
|
||||
self.SetBackLight(value)
|
||||
|
||||
def KeyDown(self,event):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user