mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-05-02 12:47:40 +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
|
// Progressbar
|
||||||
const h = 5
|
const h = 2
|
||||||
let width
|
let width
|
||||||
if (config.widgetFamily === 'small') {
|
if (config.widgetFamily === 'small') {
|
||||||
width = 200
|
width = 120
|
||||||
} else {
|
} else {
|
||||||
width = 400
|
width = 300
|
||||||
}
|
}
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
|
@ -163,6 +163,8 @@ if (darkModeSupport) {
|
||||||
fillColorProgressbar = Color.dynamic(fillColorProgressbar, new Color('111111'))
|
fillColorProgressbar = Color.dynamic(fillColorProgressbar, new Color('111111'))
|
||||||
}
|
}
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
async function setupAssistant () {
|
async function setupAssistant () {
|
||||||
let parameter = ''
|
let parameter = ''
|
||||||
|
@ -333,7 +335,7 @@ function creatProgress(total, havegone) {
|
||||||
const context = new DrawContext()
|
const context = new DrawContext()
|
||||||
context.size = new Size(width, h)
|
context.size = new Size(width, h)
|
||||||
context.opaque = false
|
context.opaque = false
|
||||||
context.respectScreenScale = false
|
context.respectScreenScale = true
|
||||||
|
|
||||||
// Background Path
|
// Background Path
|
||||||
context.setFillColor(fillColorProgressbar)
|
context.setFillColor(fillColorProgressbar)
|
||||||
|
@ -579,7 +581,7 @@ const files = FileManager.local()
|
||||||
|
|
||||||
// Set up cache
|
// Set up cache
|
||||||
const cacheNamePostfix = ((number) ? number.substr(number.length - 4) : 'networkLogin') + ( cacheUUID ? `-${cacheUUID}` : '')
|
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 cacheExists = files.fileExists(cachePath)
|
||||||
const cacheDate = cacheExists ? files.modificationDate(cachePath) : 0
|
const cacheDate = cacheExists ? files.modificationDate(cachePath) : 0
|
||||||
|
|
||||||
|
@ -729,6 +731,7 @@ if (data !== undefined) {
|
||||||
progressBarStack.addSpacer()
|
progressBarStack.addSpacer()
|
||||||
|
|
||||||
const progressBar = progressBarStack.addImage(creatProgress(total, total - remainingDays))
|
const progressBar = progressBarStack.addImage(creatProgress(total, total - remainingDays))
|
||||||
|
progressBar.imageSize = new Size(width, h)
|
||||||
progressBarStack.addSpacer()
|
progressBarStack.addSpacer()
|
||||||
widget.addSpacer(4)
|
widget.addSpacer(4)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue