mirror of
https://github.com/ThisIsBenny/iOS-Widgets.git
synced 2025-06-06 13:37:41 +00:00
Fix issue with small widget
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
ed8dbe90ae
commit
25c6bfc328
2 changed files with 29 additions and 19 deletions
|
@ -3,9 +3,11 @@
|
||||||
// icon-color: deep-green; icon-glyph: bus-alt;
|
// icon-color: deep-green; icon-glyph: bus-alt;
|
||||||
|
|
||||||
/**************
|
/**************
|
||||||
Version 1.2.0
|
Version 1.2.1
|
||||||
|
|
||||||
Changelog:
|
Changelog:
|
||||||
|
v1.2.1:
|
||||||
|
- Fix issue with small widget where time will be not correct displayed in case that a delay will be displayed
|
||||||
v1.2.0:
|
v1.2.0:
|
||||||
- show original time and the delay in red
|
- show original time and the delay in red
|
||||||
v1.1.0:
|
v1.1.0:
|
||||||
|
@ -243,9 +245,10 @@ widget.backgroundGradient = gradient
|
||||||
|
|
||||||
let firstLineStack = widget.addStack()
|
let firstLineStack = widget.addStack()
|
||||||
|
|
||||||
let provider = firstLineStack.addText("🚏 " + stationName)
|
let stationText = firstLineStack.addText("🚏 " + stationName)
|
||||||
provider.font = Font.boldSystemFont(12)
|
stationText.font = Font.boldSystemFont(12)
|
||||||
provider.textColor = new Color(textColor)
|
stationText.textColor = new Color(textColor)
|
||||||
|
stationText.lineLimit = 2
|
||||||
|
|
||||||
// Last Update
|
// Last Update
|
||||||
firstLineStack.addSpacer()
|
firstLineStack.addSpacer()
|
||||||
|
@ -271,20 +274,27 @@ let directionColumn = row.addStack()
|
||||||
directionColumn.layoutVertically()
|
directionColumn.layoutVertically()
|
||||||
|
|
||||||
data.forEach(function(l) {
|
data.forEach(function(l) {
|
||||||
let timeStack = timeColumn.addStack()
|
if (config.widgetFamily !== 'small') {
|
||||||
timeStack.layoutHorizontally()
|
let timeStack = timeColumn.addStack()
|
||||||
timeStack.spacing = 2
|
timeStack.layoutHorizontally()
|
||||||
|
timeStack.spacing = 2
|
||||||
|
|
||||||
let timeText = timeStack.addText(`${l.orgHour}:${l.orgMinute}`)
|
let timeText = timeStack.addText(`${l.orgHour}:${l.orgMinute}`)
|
||||||
timeText.font = Font.mediumSystemFont(12)
|
timeText.font = Font.mediumSystemFont(12)
|
||||||
timeText.textColor = new Color(textColor)
|
timeText.textColor = new Color(textColor)
|
||||||
timeText.leftAlignText()
|
timeText.leftAlignText()
|
||||||
|
|
||||||
if (parseInt(l.delay) > 0) {
|
if (parseInt(l.delay) > 0) {
|
||||||
let delayText = timeStack.addText(`+${l.delay}`)
|
let delayText = timeStack.addText(`+${l.delay}`)
|
||||||
delayText.font = Font.mediumSystemFont(12)
|
delayText.font = Font.mediumSystemFont(12)
|
||||||
delayText.textColor = Color.red()
|
delayText.textColor = Color.red()
|
||||||
delayText.leftAlignText()
|
delayText.leftAlignText()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let timeText = timeColumn.addText(`${l.hour}:${l.minute}`)
|
||||||
|
timeText.font = Font.mediumSystemFont(12)
|
||||||
|
timeText.textColor = new Color(textColor)
|
||||||
|
timeText.leftAlignText()
|
||||||
}
|
}
|
||||||
|
|
||||||
let lineText = lineColumn.addText(l.name)
|
let lineText = lineColumn.addText(l.name)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "VRR-Monitor",
|
"name": "VRR-Monitor",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"scriptURL": "https://raw.githubusercontent.com/ThisIsBenny/iOS-Widgets/main/VRR-Monitor/VRR-Monitor.js",
|
"scriptURL": "https://raw.githubusercontent.com/ThisIsBenny/iOS-Widgets/main/VRR-Monitor/VRR-Monitor.js",
|
||||||
"previewURL": "https://raw.githubusercontent.com/ThisIsBenny/iOS-Widgets/main/VRR-Monitor/previewLight.jpeg",
|
"previewURL": "https://raw.githubusercontent.com/ThisIsBenny/iOS-Widgets/main/VRR-Monitor/previewLight.jpeg",
|
||||||
"descriptionURL": "https://github.com/ThisIsBenny/iOS-Widgets/blob/main/VRR-Monitor/README.md"
|
"descriptionURL": "https://github.com/ThisIsBenny/iOS-Widgets/blob/main/VRR-Monitor/README.md"
|
||||||
|
|
Loading…
Add table
Reference in a new issue