Phase 2: 10-icon menu ring
Rotating ring modeled after the watch Controls menu: UP/DOWN spin,
START/STOP selects. Selection point sits at −30° (≈ 2 o'clock) so it
lines up with the physical enter button on 5-button round Garmins.
Icons are rasterized at 80×80 with automaticPalette="false" and
scaled via drawBitmap2 to stay crisp at any display resolution. Long
German compounds ("Einsatzbeginn", "Beweismittel", "Letzten löschen")
wrap to two lines via a Config array so the center label never
overlaps the surrounding icons. Selected index is persisted in
Application.Storage and restored on next launch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
43f970d764
commit
d3494acc0d
18 changed files with 203 additions and 75 deletions
31
source/MenuDelegate.mc
Normal file
31
source/MenuDelegate.mc
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import Toybox.Lang;
|
||||
import Toybox.WatchUi;
|
||||
|
||||
// Routes menu input. UP/DOWN rotate the ring; START/STOP selects.
|
||||
// Dispatch of event-type keys is wired up in later phases — for now
|
||||
// each selection just logs and no-ops.
|
||||
class MenuDelegate extends WatchUi.BehaviorDelegate {
|
||||
|
||||
private var _view as MenuView;
|
||||
|
||||
function initialize(view as MenuView) {
|
||||
BehaviorDelegate.initialize();
|
||||
_view = view;
|
||||
}
|
||||
|
||||
function onNextPage() as Boolean {
|
||||
_view.rotateNext();
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPreviousPage() as Boolean {
|
||||
_view.rotatePrev();
|
||||
return true;
|
||||
}
|
||||
|
||||
function onSelect() as Boolean {
|
||||
var item = _view.selectedItem();
|
||||
Logger.log("menu.select: " + (item[:key] as String));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue