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