fix progressbar issue

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2020-12-30 01:08:36 +01:00
parent ed989b6fdb
commit 4412fe44b6
No known key found for this signature in database
GPG key ID: 69DE3C3C097DB7F7

View file

@ -136,12 +136,12 @@ const numberOfDisplayedDataBySize = {
}
// Progressbar
const h = 5
const h = 2
let width
if (config.widgetFamily === 'small') {
width = 200
width = 120
} else {
width = 400
width = 300
}
// Colors
@ -163,6 +163,8 @@ if (darkModeSupport) {
fillColorProgressbar = Color.dynamic(fillColorProgressbar, new Color('111111'))
}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
async function setupAssistant () {
let parameter = ''
@ -333,7 +335,7 @@ function creatProgress(total, havegone) {
const context = new DrawContext()
context.size = new Size(width, h)
context.opaque = false
context.respectScreenScale = false
context.respectScreenScale = true
// Background Path
context.setFillColor(fillColorProgressbar)
@ -579,7 +581,7 @@ const files = FileManager.local()
// Set up cache
const cacheNamePostfix = ((number) ? number.substr(number.length - 4) : 'networkLogin') + ( cacheUUID ? `-${cacheUUID}` : '')
const cachePath = files.joinPath(files.documentsDirectory(), "widget-vodafone-" + cacheNamePostfix)
const cachePath = files.joinPath(files.cacheDirectory(), "widget-vodafone-" + cacheNamePostfix)
const cacheExists = files.fileExists(cachePath)
const cacheDate = cacheExists ? files.modificationDate(cachePath) : 0
@ -729,6 +731,7 @@ if (data !== undefined) {
progressBarStack.addSpacer()
const progressBar = progressBarStack.addImage(creatProgress(total, total - remainingDays))
progressBar.imageSize = new Size(width, h)
progressBarStack.addSpacer()
widget.addSpacer(4)
}