From 9751dac79ee5b8b36fa8aea0eab86b8ed08aca58 Mon Sep 17 00:00:00 2001 From: cuu Date: Tue, 25 Dec 2018 02:57:46 +0000 Subject: [PATCH] titlebar roundrobin check --- main.go | 1 + sysgo/UI/title_bar.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e43686d..c8a80df 100644 --- a/main.go +++ b/main.go @@ -292,6 +292,7 @@ func run() int { go FlashLed1(main_screen) go InspectionTeam(main_screen) + go main_screen.TitleBar.RoundRobinCheck() running := true for running { diff --git a/sysgo/UI/title_bar.go b/sysgo/UI/title_bar.go index 8ec0c41..10eb2db 100644 --- a/sysgo/UI/title_bar.go +++ b/sysgo/UI/title_bar.go @@ -70,7 +70,7 @@ func (self *TitleBarIconItem) Draw() { // lab_x,lab_y := self.Label.Coord() lab_w,lab_h:= self.Label.Size() if self.Align == ALIGN["VCenter"] { - self.Label.NewCoord( self.PosX - lab_w/2 + parent_x, self.PosY + self.Height/2+6 + parent_y) + self.Label.NewCoord( self.PosX - lab_w/2 + parent_x, self.PosY + self.Height/2+6 + parent_y) }else if self.Align == ALIGN["HLeft"] { self.Label.NewCoord( self.PosX + self.Width/2+3 + parent_x, self.PosY - lab_h/2 + parent_y ) } @@ -296,8 +296,9 @@ func (self *TitleBar) SetBatteryStat( bat int) { } func (self *TitleBar) CheckBluetooth() { - + out := System("hcitool dev | grep hci0 |cut -f3") + if len(out) < 17 { fmt.Println("Titlebar CheckBluetooth: no bluetooth",out) self.Icons["bluetooth"].SetIconIndex(2)