mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-05-01 20:27:41 +00:00
fix progressbar issue
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
ed989b6fdb
commit
4412fe44b6
1 changed files with 8 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue