Update VodafoneDE.js

Verbesserungen
This commit is contained in:
Chaos53925 2023-09-20 13:23:51 +02:00
parent bb78020f8c
commit 9d9f826d62

View file

@ -429,14 +429,13 @@ function getDiagram(percentage, isFlat) {
canvas.setTextAlignedCenter() canvas.setTextAlignedCenter()
canvas.setTextColor(textColor) canvas.setTextColor(textColor)
canvas.setFont(Font.boldSystemFont(canvTextSize)) canvas.setFont(Font.boldSystemFont(canvTextSize))
const infinitySize = canvSize / 2;
if (isFlat === true) { if (isFlat === true) {
const infinitySize = canvSize / 2;
canvas.setFont(Font.boldSystemFont(infinitySize)); canvas.setFont(Font.boldSystemFont(infinitySize));
if (config.widgetFamily === "small" || "medium" || "large" || "extraLarge") { if (config.widgetFamily === "small" || "medium" || "large" || "extraLarge") {
const textRect = new Rect(0, infinitySize / 3, canvSize, canvSize); const textRect = new Rect(0, infinitySize / 3, canvSize, canvSize);
canvas.drawTextInRect(``, textRect); canvas.drawTextInRect(``, textRect);
} else { } else {
const infinitySize = canvSize / 2;
canvas.setFont(Font.boldSystemFont(infinitySize)); canvas.setFont(Font.boldSystemFont(infinitySize));
const textRect = new Rect(0, infinitySize / 1, canvSize, canvSize); const textRect = new Rect(0, infinitySize / 1, canvSize, canvSize);
canvas.drawTextInRect(``, textRect); canvas.drawTextInRect(``, textRect);
@ -475,10 +474,10 @@ function getTotalValues(v) {
totalValues = `Flat` totalValues = `Flat`
} else { } else {
if (v.used <= 1024) { if (v.used <= 1024) {
totalValues = `${v.used} MB verbraucht.` totalValues = `${v.used} MB verbraucht`
} else { } else {
let usedGB = (v.used / 1024).toFixed(2) let usedGB = (v.used / 1024).toFixed(2)
totalValues = `${usedGB} GB verbraucht.` totalValues = `${usedGB} GB verbraucht`
} }
} }
} else { } else {