-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
I’m using iOS 18.5. Relevant code is as follows:
// Determine widget size
let widgetSize = config.widgetFamily || "large";
let isSmall = widgetSize === "small";
let isMedium = widgetSize === "medium";
let isLarge = widgetSize === "large";
// Get the script's directory and check for background images
const fm = FileManager.local();
const scriptPath = module.filename;
const scriptDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
const imagesDir = fm.joinPath(scriptDir, 'images');
// Check for size-specific background image
const bgImageName = `days-left-background-image-${widgetSize}.jpg`;
const bgImagePath = fm.joinPath(imagesDir, bgImageName);
// Set background image if it exists, otherwise set background color
if (fm.fileExists(bgImagePath)) {
const image = Image.fromFile(bgImagePath);
widget.backgroundImage = image;
} else {
widget.backgroundColor = backgroundColor;
}
Did I miss something?
Metadata
Metadata
Assignees
Labels
No labels