fix: fixed widget positioning for rounded corners, fixed logo

This commit is contained in:
Савелий Савенок
2024-10-20 03:08:32 +03:00
parent e8062061b4
commit a75ffcbfb8
6 changed files with 23 additions and 17 deletions

View File

@@ -3,15 +3,16 @@ import * as hmUI from '@zos/ui'
import fontArray from '../fontData/secondaryFont'
let batteryWg;
const moduleX = 310
const moduleY = 10
export default function(){
console.log("[modules]: battery module init")
let battery = new hmSensor.Battery()
updateBatteryWidget(battery.getCurrent())
battery.onChange(() => updateBatteryWidget(battery.getCurrent()))
hmUI.createWidget(hmUI.widget.IMG, {
x: 355,
y: 10,
x: moduleX,
y: moduleY,
src: 'date/perc.PNG'
})
}
@@ -20,8 +21,8 @@ function updateBatteryWidget(batteryPercentage){
hmUI.deleteWidget(batteryWg)
}
batteryWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
x: 270,
y: 10,
x: moduleX - 85,
y: moduleY,
type: hmUI.data_type.BATTERY,
font_array: fontArray,
h_space: 1,