From 32d48122517623c581052c7adb51bb5be66c780d Mon Sep 17 00:00:00 2001 From: kkayam Date: Tue, 18 Feb 2025 18:15:47 +0000 Subject: [PATCH] use 48 icon size --- apps/cutelauncher/ChangeLog | 1 + apps/cutelauncher/Changelog | 1 + apps/cutelauncher/app.js | 12 ++++-------- apps/cutelauncher/metadata.json | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/cutelauncher/ChangeLog b/apps/cutelauncher/ChangeLog index 2d0999671..74265d8b2 100644 --- a/apps/cutelauncher/ChangeLog +++ b/apps/cutelauncher/ChangeLog @@ -1 +1,2 @@ 0.27: New app introduced to the app loader! +0.28: Adjusted icon size to better fit with native dimensions (48x48) diff --git a/apps/cutelauncher/Changelog b/apps/cutelauncher/Changelog index 2d0999671..74265d8b2 100644 --- a/apps/cutelauncher/Changelog +++ b/apps/cutelauncher/Changelog @@ -1 +1,2 @@ 0.27: New app introduced to the app loader! +0.28: Adjusted icon size to better fit with native dimensions (48x48) diff --git a/apps/cutelauncher/app.js b/apps/cutelauncher/app.js index 8bd634050..c2ec5a778 100644 --- a/apps/cutelauncher/app.js +++ b/apps/cutelauncher/app.js @@ -119,11 +119,7 @@ // Calculate icon dimensions let icon = apps[idx].icon; - let iconWidth = icon.width || 48; - let iconHeight = icon.height || 48; - let maxSize = 45; - let scale = Math.min(maxSize / iconWidth, maxSize / iconHeight); - let scaledHeight = Math.floor(iconHeight * scale); + let iconSize = 48; // Define rectangle size (independent of icon size) const rectSize = 80; @@ -144,8 +140,8 @@ // Draw icon centered in the top portion let iconPadding = 8; // Center icon within the rectangle - let iconXInRect = rectX + (rectSize - maxSize) / 2; - g.setBgColor(g.theme.bg2).drawImage(icon, iconXInRect, rect.y + iconPadding + 8, { scale: scale }); + let iconXInRect = rectX + (rectSize - iconSize) / 2; + g.setBgColor(g.theme.bg2).drawImage(icon, iconXInRect, rect.y + iconPadding + 8); // Draw app name with ellipsis if too long const maxWidth = rectSize - 8; @@ -160,7 +156,7 @@ } text = text + ellipsis; } - let textY = rect.y + iconPadding + scaledHeight + 15; + let textY = rect.y + iconPadding + iconSize + 15; g.drawString(text, rectX + rectSize / 2, textY); }, select: (idx) => { diff --git a/apps/cutelauncher/metadata.json b/apps/cutelauncher/metadata.json index 223db8648..7b428ceb8 100644 --- a/apps/cutelauncher/metadata.json +++ b/apps/cutelauncher/metadata.json @@ -2,7 +2,7 @@ "id": "cutelauncher", "name": "Cute Launcher", "shortName": "Cute Launcher", - "version": "0.27", + "version": "0.28", "description": "A simple launcher app for Bangle.js 2 that makes use of the full touchscreen", "icon": "app.png", "type": "launch",