summaryrefslogtreecommitdiff
path: root/source/ui/GlanceView.mc
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
committercirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
commitb8addc87f804789368612bf8e1be31a2bf28efe1 (patch)
treebece4051eb6f009eba05ffdd585420232741a7d7 /source/ui/GlanceView.mc
parent140a6660f63f88d05ba9aae0bf1c4b401bb6574d (diff)
test(ui): second UI scenario, and the fixes it found
A second UI-test build (uitest-extra.jungle) covers the legacy PIN and the forced new PIN, Change and Reset PIN, a queued Require PIN, UPC-A, Code 39, the code error screen, the encoding progress, auto-lock on a barcode, the light theme and the glance without a code; the main flow adds the Steam and Library details and the menu's text screens. Fixed from what it found: Entry IDs tripped the watchdog with 110 entries; auto-lock didn't close a locked barcode; a queued Require PIN showed "Confirm in menu"; locked barcodes lacked the padlock; the PIN keypad's bottom row, the Reset PIN question, text-screen bottoms, the glance title and the light-theme warning colour. Goldens approved on all seven watches; only the Forerunner 70 was re-verified after the version bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'source/ui/GlanceView.mc')
-rw-r--r--source/ui/GlanceView.mc23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/ui/GlanceView.mc b/source/ui/GlanceView.mc
index 4540f2a..6be18f3 100644
--- a/source/ui/GlanceView.mc
+++ b/source/ui/GlanceView.mc
@@ -89,8 +89,15 @@ class OtpGlanceView extends WatchUi.GlanceView {
var h = dc.getHeight();
var top = h / 2 - dc.getFontHeight(Graphics.FONT_GLANCE);
var x = inset(dc, top);
+ // In capitals the name reaches the round screen's edge on the
+ // Forerunner 70 and 965, which cuts the last letter; the narrower
+ // mixed case fits there.
+ var title = "OTP WALLET";
+ if (x + dc.getTextWidthInPixels(title, Graphics.FONT_GLANCE) > dc.getWidth() - edgeCut(top)) {
+ title = "OTP Wallet";
+ }
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText(x, top, Graphics.FONT_GLANCE, "OTP WALLET", Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText(x, top, Graphics.FONT_GLANCE, title, Graphics.TEXT_JUSTIFY_LEFT);
dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
dc.drawText(x, h / 2, Graphics.FONT_GLANCE, count == 1 ? "1 entry" : count + " entries",
Graphics.TEXT_JUSTIFY_LEFT);
@@ -103,15 +110,23 @@ class OtpGlanceView extends WatchUi.GlanceView {
// screen's top-left curve; on most round watches this is 0 or a few
// pixels).
private function inset(dc as Graphics.Dc, y as Number) as Number {
+ var left = (System.getDeviceSettings().screenWidth - dc.getWidth()) / 2;
+ var edge = edgeCut(y);
+ return edge > left ? edge - left : 0;
+ }
+
+ // How far a round screen's edge reaches in from each side at height y
+ // (0 on other shapes), with the same assumption: the glance starts at
+ // the top of the screen. The right end of a glance reaches the screen's
+ // edge, so this is also what the curve cuts off there.
+ private function edgeCut(y as Number) as Number {
var screen = System.getDeviceSettings();
if (screen.screenShape != System.SCREEN_SHAPE_ROUND) {
return 0;
}
var r = screen.screenWidth / 2;
var dy = r - y;
- var edge = r - Math.sqrt(r * r - dy * dy).toNumber();
- var left = (screen.screenWidth - dc.getWidth()) / 2;
- return edge > left ? edge - left : 0;
+ return r - Math.sqrt(r * r - dy * dy).toNumber();
}
// The label, the code and a bar for the seconds left in the period.