Revert "fix title_bar Refresh"

This reverts commit 961ee5dbb014c70edc05a742bb41dc4bc6be6057.
This commit is contained in:
cuu 2023-01-24 14:47:35 +08:00
parent 961ee5dbb0
commit 4eefd21a8b

View File

@ -175,7 +175,6 @@ func (self *TitleBar) UpdateDownloadStatus() {
func (self *TitleBar) RoundRobinCheck() { func (self *TitleBar) RoundRobinCheck() {
for { for {
gotime.Sleep(3000 * gotime.Millisecond)
if self.InLowBackLight < 0 { if self.InLowBackLight < 0 {
self.CheckBatteryStat() self.CheckBatteryStat()
@ -198,6 +197,8 @@ func (self *TitleBar) RoundRobinCheck() {
} }
gotime.Sleep(3000 * gotime.Millisecond)
} }
} }
@ -217,6 +218,7 @@ func (self *TitleBar) IsWifiConnectedNow() bool {
} }
func (self *TitleBar) UpdateWifiStrength() { func (self *TitleBar) UpdateWifiStrength() {
self.Draw(self.Title)
} }
func (t *TitleBar) GetWifiStrength() int { func (t *TitleBar) GetWifiStrength() int {
@ -531,7 +533,7 @@ func (self *TitleBar) Draw(title string) {
if self.IsWifiConnectedNow() == true { if self.IsWifiConnectedNow() == true {
ge := self.GetWifiStrength() ge := self.GetWifiStrength()
fmt.Println("wifi ge: ",ge) //fmt.Println("wifi ge: ",ge)
if ge > 0 { if ge > 0 {
self.Icons["wifistatus"].SetIconIndex(ge) self.Icons["wifistatus"].SetIconIndex(ge)
self.Icons["wifistatus"].NewCoord(start_x+self.IconWidth+5, self.IconHeight/2+(self.BarHeight-self.IconHeight)/2) self.Icons["wifistatus"].NewCoord(start_x+self.IconWidth+5, self.IconHeight/2+(self.BarHeight-self.IconHeight)/2)
@ -576,7 +578,6 @@ L:
select { select {
case v:= <- self.updateScreen: case v:= <- self.updateScreen:
if v == true { if v == true {
self.Draw(self.Title)
DisplayFlip() DisplayFlip()
} }
if v== false { if v== false {