diff --git a/Apps/AirMouse/main/Source/MainView.cpp b/Apps/AirMouse/main/Source/MainView.cpp index 29309aee..ccb21de8 100644 --- a/Apps/AirMouse/main/Source/MainView.cpp +++ b/Apps/AirMouse/main/Source/MainView.cpp @@ -2,6 +2,7 @@ #include +#include #include namespace { @@ -80,4 +81,5 @@ void mainViewCreate(Context* ctx) { ctx->leftClickBtn = createClickPad(row, tr("Left"), onLeftPressed, onLeftReleased, ctx); ctx->rightClickBtn = createClickPad(row, tr("Right"), onRightPressed, onRightReleased, ctx); + lvgl_grid_navigation_add(row); } diff --git a/Apps/AirMouse/manifest.properties b/Apps/AirMouse/manifest.properties index 72ec0fc2..8c09a484 100644 --- a/Apps/AirMouse/manifest.properties +++ b/Apps/AirMouse/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32s3,esp32p4,esp32s31 id=tactility.airmouse -version.name=0.12.0 -version.code=12 +version.name=0.13.0 +version.code=13 name=Air Mouse description.short=Bluetooth tilt air mouse description=Turns the device into a Bluetooth LE mouse. Rotate the device to move the pointer and tap the two on-screen pads for the left and right buttons. It pairs with a PC, phone or tablet like any other Bluetooth mouse.\n\nThe pointer follows the rotation measured by the gyroscope, so it works the same whether the device is held upright or on its side. Features: automatic calibration, adjustable sensitivity, a settings screen and an optional auto-clutch that freezes the pointer while you reposition the device.\n\nRequires a gyroscope and Bluetooth. diff --git a/Apps/AudioRecorder/main/Source/AudioRecorder.cpp b/Apps/AudioRecorder/main/Source/AudioRecorder.cpp index 49cab539..a53cba62 100644 --- a/Apps/AudioRecorder/main/Source/AudioRecorder.cpp +++ b/Apps/AudioRecorder/main/Source/AudioRecorder.cpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -370,6 +371,7 @@ void addPlayerPanel(Context* ctx, lv_obj_t* list, const RecordingItem& item) { lv_obj_set_style_text_font(stop_label, lvgl_get_text_font(FONT_SIZE_DEFAULT), 0); lv_label_set_text(stop_label, (std::string(LV_SYMBOL_STOP " ") + tr("Stop")).c_str()); lv_obj_center(stop_label); + lvgl_grid_navigation_add(controls); } void buildListCard(Context* ctx, lv_obj_t* parent) { diff --git a/Apps/AudioRecorder/manifest.properties b/Apps/AudioRecorder/manifest.properties index 65a0076c..1cd759d8 100644 --- a/Apps/AudioRecorder/manifest.properties +++ b/Apps/AudioRecorder/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32s3,esp32p4,esp32s31 id=tactility.audiorecorder -version.name=0.5.0 -version.code=5 +version.name=0.6.0 +version.code=6 name=Recorder description.short=Record and play WAV audio description=Records 16 kHz, mono, 16-bit WAV audio from the device's microphone and plays it back.\n\nTap a recording to fold out its player beneath the row, with a progress bar, elapsed and total time, and Play, Pause and Stop. Recordings are listed newest-first with their duration, size and date, and can be deleted from the toolbar. Recordings are limited to 5 minutes. The layout follows the Material theme and fills the screen from small 320x240 panels to large landscape displays. diff --git a/Apps/Calendar/main/Source/CalendarApp.cpp b/Apps/Calendar/main/Source/CalendarApp.cpp index 62e66dd4..447a3290 100644 --- a/Apps/Calendar/main/Source/CalendarApp.cpp +++ b/Apps/Calendar/main/Source/CalendarApp.cpp @@ -139,7 +139,9 @@ void refreshVisibility(CalendarContext* context) { void focusContent(CalendarContext* context) { lv_obj_t* focus = !context->splitLayout && context->page == CalendarPage::Month ? context->monthGrid.days : context->agendaPanel; - if (focus != nullptr) lv_group_focus_obj(focus); + if (focus == nullptr) return; + lv_group_focus_obj(focus); + if (focus == context->monthGrid.days) monthGridFocusSelected(context->monthGrid, selectedDate(context)); } void showSettings(CalendarContext* context, bool visible) { diff --git a/Apps/Calendar/main/Source/MonthGrid.cpp b/Apps/Calendar/main/Source/MonthGrid.cpp index 937df3bf..be175764 100644 --- a/Apps/Calendar/main/Source/MonthGrid.cpp +++ b/Apps/Calendar/main/Source/MonthGrid.cpp @@ -62,7 +62,9 @@ void monthGridFill(const MonthGrid& grid, int year, int month, const std::vector const int offset = calendarWeekday({year, month, 1}); const int dayCount = calendarDaysInMonth(year, month); - lv_obj_t* focus = nullptr; + // A refresh must not take the focus away, e.g. from the toolbar's month buttons + lv_group_t* group = lv_obj_get_group(grid.days); + const bool focused = group != nullptr && lv_group_get_focused(group) == grid.days; for (int cell = 0; cell < offset + dayCount; ++cell) { const int day = cell - offset + 1; if (day < 1) { @@ -79,7 +81,18 @@ void monthGridFill(const MonthGrid& grid, int year, int month, const std::vector const CalendarDate date {year, month, day}; dayButtonSet(button, date, text, events, compact); dayButtonSetState(button, selected, today); - if (date == selected || focus == nullptr) focus = button; + } + if (focused) monthGridFocusSelected(grid, selected); +} + +void monthGridFocusSelected(const MonthGrid& grid, const CalendarDate& selected) { + lv_obj_t* focus = nullptr; + const uint32_t count = lv_obj_get_child_count(grid.days); + for (uint32_t i = 0; i < count; ++i) { + lv_obj_t* child = lv_obj_get_child(grid.days, static_cast(i)); + // Blank cells have no children. + if (lv_obj_get_child_count(child) == 0) continue; + if (focus == nullptr || dayButtonDate(child) == selected) focus = child; } if (focus != nullptr) lvgl_grid_navigation_focus_without_touch(grid.days, focus); } diff --git a/Apps/Calendar/main/Source/MonthGrid.h b/Apps/Calendar/main/Source/MonthGrid.h index 290c1c89..7e9bf342 100644 --- a/Apps/Calendar/main/Source/MonthGrid.h +++ b/Apps/Calendar/main/Source/MonthGrid.h @@ -19,3 +19,5 @@ void monthGridFill(const MonthGrid& grid, int year, int month, const std::vector const CalendarDate& selected, const CalendarDate& today, lv_event_cb_t onDayClicked, void* userData); void monthGridSelect(const MonthGrid& grid, const CalendarDate& selected, const CalendarDate& today); +// Gives the selected day the focus within the grid, on devices without a touchscreen. +void monthGridFocusSelected(const MonthGrid& grid, const CalendarDate& selected); diff --git a/Apps/Calendar/manifest.properties b/Apps/Calendar/manifest.properties index 8b008733..00b30060 100644 --- a/Apps/Calendar/manifest.properties +++ b/Apps/Calendar/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32,esp32s3,esp32c6,esp32p4,esp32s31 id=tactility.calendar -version.name=0.6.0 -version.code=8 +version.name=0.7.0 +version.code=9 name=Calendar description.short=Read-only CalDAV calendar description=View your CalDAV calendar in a month view, selected-day agenda, and upcoming agenda. Sync downloads and caches events for later viewing. diff --git a/Apps/Diceware/main/Source/Diceware.cpp b/Apps/Diceware/main/Source/Diceware.cpp index f5160790..2f662ebd 100644 --- a/Apps/Diceware/main/Source/Diceware.cpp +++ b/Apps/Diceware/main/Source/Diceware.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -279,6 +280,7 @@ void dicewareCreateWidgets(lv_obj_t* parent, void* userData) { createButton(footer, LV_SYMBOL_PLUS, onMoreClicked, ctx); auto* roll = createButton(footer, tr("Roll"), onRollClicked, ctx); lv_obj_set_flex_grow(roll, 1); + lvgl_grid_navigation_add(footer); // A phrase is shown right away, and kept when the window is rebuilt if (!ctx->busy && ctx->words.empty() && !ctx->failed) { diff --git a/Apps/Diceware/manifest.properties b/Apps/Diceware/manifest.properties index a88335fe..ce415c36 100644 --- a/Apps/Diceware/manifest.properties +++ b/Apps/Diceware/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=all id=tactility.diceware -version.name=0.30.0 -version.code=30 +version.name=0.31.0 +version.code=31 name=Diceware description.short=Passphrase generator description=Generates random passphrases with the Diceware method, based on a word list.\n\nInstead of rolling dice, each word is picked with a 32-bit random number. The ESP32 hardware random generator gives better randomness while the Wi-Fi radio is on, so the app asks to enable it. You do not have to be connected to a network. diff --git a/Apps/GPIO/main/Source/Gpio.cpp b/Apps/GPIO/main/Source/Gpio.cpp index 79afb5a2..290bc5b1 100644 --- a/Apps/GPIO/main/Source/Gpio.cpp +++ b/Apps/GPIO/main/Source/Gpio.cpp @@ -496,6 +496,7 @@ static void createTimeline(Context* ctx) { auto* interval = lv_button_create(tools); lv_obj_add_event_cb(interval, onIntervalPressed, LV_EVENT_SHORT_CLICKED, ctx); ctx->intervalLabel = lv_label_create(interval); + lvgl_grid_navigation_add(tools); ctx->spanLabel = lv_label_create(tools); lv_obj_set_style_text_font(ctx->spanLabel, lvgl_get_text_font(FONT_SIZE_SMALL), 0); diff --git a/Apps/GPIO/manifest.properties b/Apps/GPIO/manifest.properties index 5c9d6674..752ce598 100644 --- a/Apps/GPIO/manifest.properties +++ b/Apps/GPIO/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=all id=tactility.gpio -version.name=0.30.0 -version.code=30 +version.name=0.31.0 +version.code=31 name=GPIO description.short=Live state of all GPIO pins description=Shows the live state of all GPIO pins of the device. Use it to check wiring and to see which pins are high or low. diff --git a/Apps/M5UnitTest/main/Source/TestUnitDualButton.cpp b/Apps/M5UnitTest/main/Source/TestUnitDualButton.cpp index c207150c..cc998b15 100644 --- a/Apps/M5UnitTest/main/Source/TestUnitDualButton.cpp +++ b/Apps/M5UnitTest/main/Source/TestUnitDualButton.cpp @@ -2,6 +2,7 @@ #include "M5UnitTest.h" #include "UiScale.h" #include +#include #include #include @@ -70,6 +71,8 @@ lv_obj_t* makePinRow(lv_obj_t* parent, const char* label, lv_obj_set_style_text_align(valLbl, LV_TEXT_ALIGN_CENTER, 0); *outLbl = valLbl; + lvgl_grid_navigation_add(row); + lv_obj_t* btnPlus = lv_button_create(row); lv_obj_set_size(btnPlus, btnSz, btnSz); lv_obj_add_event_cb(btnPlus, cbUp, LV_EVENT_CLICKED, userData); diff --git a/Apps/M5UnitTest/main/Source/TestUnitLcd.cpp b/Apps/M5UnitTest/main/Source/TestUnitLcd.cpp index c6c9f89e..010d8ac2 100644 --- a/Apps/M5UnitTest/main/Source/TestUnitLcd.cpp +++ b/Apps/M5UnitTest/main/Source/TestUnitLcd.cpp @@ -3,6 +3,7 @@ #include "GroveLookup.h" #include "UiScale.h" #include +#include #include #include @@ -151,6 +152,7 @@ void testUnitLcdStart(TestUnitLcd* self, lv_obj_t* parent, Context* app) { lv_obj_t* lBlue = lv_label_create(btnBlue); lv_label_set_text(lBlue, "Fill Blue"); lv_obj_set_style_text_font(lBlue, fnt, 0); + lvgl_grid_navigation_add(fillRow); // Text test button lv_obj_t* btnText = lv_button_create(cont); diff --git a/Apps/M5UnitTest/main/Source/TestUnitMidi.cpp b/Apps/M5UnitTest/main/Source/TestUnitMidi.cpp index 3b94232d..d0ad9e39 100644 --- a/Apps/M5UnitTest/main/Source/TestUnitMidi.cpp +++ b/Apps/M5UnitTest/main/Source/TestUnitMidi.cpp @@ -3,6 +3,7 @@ #include "GroveLookup.h" #include "UiScale.h" #include +#include #include namespace { @@ -125,6 +126,7 @@ void testUnitMidiStart(TestUnitMidi* self, lv_obj_t* parent, Context* app) { lv_obj_add_event_cb(bUp, up, LV_EVENT_CLICKED, self); lv_obj_t* lU = lv_label_create(bUp); lv_label_set_text(lU, "+"); lv_obj_set_style_text_font(lU, fntS, 0); + lvgl_grid_navigation_add(row); }; makeAdjRow("Channel:", onChDown, onChUp); makeAdjRow("Program:", onProgDown, onProgUp); @@ -150,6 +152,7 @@ void testUnitMidiStart(TestUnitMidi* self, lv_obj_t* parent, Context* app) { lv_obj_add_event_cb(btnOff, onNoteOffClicked, LV_EVENT_CLICKED, self); lv_obj_t* lOff = lv_label_create(btnOff); lv_label_set_text(lOff, "Note Off"); lv_obj_set_style_text_font(lOff, fntS, 0); + lvgl_grid_navigation_add(noteRow); Device* uart = findGroveUartDevice(); if (!uart || !device_is_ready(uart) || !self->unit_.begin(uart)) { diff --git a/Apps/M5UnitTest/main/Source/TestUnitPaHub.cpp b/Apps/M5UnitTest/main/Source/TestUnitPaHub.cpp index c00f8c60..2d8eb682 100644 --- a/Apps/M5UnitTest/main/Source/TestUnitPaHub.cpp +++ b/Apps/M5UnitTest/main/Source/TestUnitPaHub.cpp @@ -3,6 +3,7 @@ #include "GroveLookup.h" #include "UiScale.h" #include +#include #include #include #include @@ -162,6 +163,7 @@ void testUnitPaHubStart(TestUnitPaHub* self, lv_obj_t* parent, Context* app) { lv_obj_set_style_border_width(btnRow, 0, 0); lv_obj_set_style_pad_all(btnRow, 0, 0); + lvgl_grid_navigation_add(btnRow); for (int i = 0; i < TestUnitPaHub::CH_COUNT; i++) { lv_obj_t* btn = lv_button_create(btnRow); lv_obj_set_flex_grow(btn, 1); diff --git a/Apps/M5UnitTest/manifest.properties b/Apps/M5UnitTest/manifest.properties index a164ad6e..4db6b957 100644 --- a/Apps/M5UnitTest/manifest.properties +++ b/Apps/M5UnitTest/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32s3,esp32p4 id=tactility.m5unittest -version.name=0.22.0 -version.code=22 +version.name=0.23.0 +version.code=23 name=M5 Unit Test description.short=Test app for M5Stack units description=Test app for M5Stack Grove units. Probes the Grove I2C port, directly or through a PaHub channel, and runs a test screen for each supported unit, such as the 8Encoder, ByteButton, CardKB2 and Color LCD units. Meant for hardware developers. diff --git a/Apps/MidiController/main/Source/MidiController.cpp b/Apps/MidiController/main/Source/MidiController.cpp index 449fcd18..86501884 100644 --- a/Apps/MidiController/main/Source/MidiController.cpp +++ b/Apps/MidiController/main/Source/MidiController.cpp @@ -1,6 +1,7 @@ #include "MidiController.h" #include "LcdDisplay.h" +#include #include #include #include @@ -410,6 +411,8 @@ lv_obj_t* MidiController::buildTransportSelectOverlay(lv_obj_t* parent) { mcLabel(card, spec.subtitle, fontSmall, MC_LABEL()); if (selected) mcLabel(card, "CURRENT", fontSmall, MC_PRIMARY()); } + lv_obj_set_style_outline_width(row, 0, LV_STATE_FOCUS_KEY); + lvgl_grid_navigation_add(row); if (currentViewRoot_ != nullptr) { mcLabel(root, "The toolbar switch starts and stops sending.", fontSmall, MC_LABEL()); @@ -741,6 +744,9 @@ void MidiController::buildHomeView(lv_obj_t* parent) { lv_obj_set_style_pad_gap(rowObj, gap, 0); lv_obj_set_style_pad_all(rowObj, 0, 0); + lv_obj_set_style_outline_width(rowObj, 0, LV_STATE_FOCUS_KEY); + lvgl_grid_navigation_add(rowObj); + for (int col = 0; col < 5; col++) { int i = row * 5 + col; lv_obj_t* btn = mcButton(rowObj); diff --git a/Apps/MidiController/manifest.properties b/Apps/MidiController/manifest.properties index bd1fa739..963db9cb 100644 --- a/Apps/MidiController/manifest.properties +++ b/Apps/MidiController/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32p4 id=tactility.midicontroller -version.name=0.10.0 -version.code=10 +version.name=0.11.0 +version.code=11 name=Midi Controller description.short=MIDI controller description=MIDI controller for the M5Stack Tab5 that sends standard MIDI over Bluetooth LE or USB to any DAW, synth or hardware.\n\nPick the transport when the app starts, flip the toolbar switch to start sending, then tap a mode tile on the home screen. Over Bluetooth the device advertises as Tactility MIDI. The 8Encoder and LCD Unit accessories are optional. diff --git a/Apps/MystifySpiDemo/ili9341-panel-settings/main/Source/main.cpp b/Apps/MystifySpiDemo/ili9341-panel-settings/main/Source/main.cpp index 7e60cad9..4d94c295 100644 --- a/Apps/MystifySpiDemo/ili9341-panel-settings/main/Source/main.cpp +++ b/Apps/MystifySpiDemo/ili9341-panel-settings/main/Source/main.cpp @@ -1,4 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 +#include #include #include @@ -887,6 +888,7 @@ void buildUi(lv_obj_t* root, Context& ctx) { lv_label_set_text(orientationTitle, "Orientation"); auto* orientationRow = createRow(panelCard, gap); + lvgl_grid_navigation_add(orientationRow); constexpr const char* ORIENTATION_LABELS[] = { "Landscape", "Portrait", "Landscape 180", "Portrait 180" }; for (int i = 0; i < 4; i++) { auto* chip = createChip(orientationRow, ORIENTATION_LABELS[i], chipMinWidth); @@ -925,6 +927,7 @@ void buildUi(lv_obj_t* root, Context& ctx) { createSectionTitle(sizeCard, "Size and bus"); auto* resolutionRow = createRow(sizeCard, gap); + lvgl_grid_navigation_add(resolutionRow); auto* presetLandscape = createChip(resolutionRow, "320x240", chipMinWidth); auto* presetPortrait = createChip(resolutionRow, "240x320", chipMinWidth); ctx.resolutionChips[0] = presetLandscape; @@ -938,6 +941,7 @@ void buildUi(lv_obj_t* root, Context& ctx) { auto* hostTitle = lv_label_create(sizeCard); lv_label_set_text(hostTitle, "SPI host"); auto* hostRow = createRow(sizeCard, gap); + lvgl_grid_navigation_add(hostRow); constexpr const char* HOST_LABELS[] = { "SPI2", "SPI3" }; for (uint32_t i = 0; i < HOST_PRESET_COUNT; i++) { auto* chip = createChip(hostRow, HOST_LABELS[i], chipMinWidth); @@ -948,6 +952,7 @@ void buildUi(lv_obj_t* root, Context& ctx) { auto* clockTitle = lv_label_create(sizeCard); lv_label_set_text(clockTitle, "SPI clock"); auto* clockRow = createRow(sizeCard, gap); + lvgl_grid_navigation_add(clockRow); constexpr const char* CLOCK_LABELS[] = { "10 MHz", "20 MHz", "40 MHz", "80 MHz" }; for (uint32_t i = 0; i < CLOCK_PRESET_COUNT; i++) { auto* chip = createChip(clockRow, CLOCK_LABELS[i], chipMinWidth); @@ -972,6 +977,7 @@ void buildUi(lv_obj_t* root, Context& ctx) { // Actions auto* actionsRow = createRow(content, gap); + lvgl_grid_navigation_add(actionsRow); auto* saveChip = createChip(actionsRow, "Save", chipMinWidth); lv_obj_add_event_cb(saveChip, onSavePressed, LV_EVENT_SHORT_CLICKED, &ctx); auto* applyChip = createChip(actionsRow, "Apply", chipMinWidth); diff --git a/Apps/MystifySpiDemo/manifest.properties b/Apps/MystifySpiDemo/manifest.properties index beadfc34..4a7d190f 100644 --- a/Apps/MystifySpiDemo/manifest.properties +++ b/Apps/MystifySpiDemo/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32p4 id=tactility.mystifyspidemo -version.name=0.12.0 -version.code=12 +version.name=0.13.0 +version.code=13 name=Mystify SPI Demo description.short=Mystify demo on an SPI panel description=Example of an app package that adds hardware. It adds a 2.8 inch ILI9341 SPI panel as a second display and draws a Mystify scene on it, mirrored on the main display.\n\nContains a kernel module with the display driver, the demo app, a settings app with live settings, a dashboard and a terminal command. Meant for developers. diff --git a/Apps/SatelliteTracker/main/Source/MapView.cpp b/Apps/SatelliteTracker/main/Source/MapView.cpp index 042b6b9d..2e0a28b4 100644 --- a/Apps/SatelliteTracker/main/Source/MapView.cpp +++ b/Apps/SatelliteTracker/main/Source/MapView.cpp @@ -267,6 +267,15 @@ bool prepareRenderer(Context* ctx, int width, int height) { return ctx->renderer.setup(width, height, format, ctx->grayscale ? map::grayTheme() : map::colorTheme()); } +/** The legend can have columns, so left and right step through it like up and down do */ +void onLegendKey(lv_event_t* event) { + lv_group_t* group = lv_obj_get_group(lv_event_get_current_target_obj(event)); + if (group == nullptr) return; + const uint32_t key = lv_event_get_key(event); + if (key == LV_KEY_RIGHT) lv_group_focus_next(group); + else if (key == LV_KEY_LEFT) lv_group_focus_prev(group); +} + void createLegendRow(Context* ctx, lv_obj_t* parent, int index, int x, int y, int width, int height, const lv_font_t* font) { MapWidgets& w = ctx->mapWidgets; const TrackedSatellite& entry = ctx->model.at(index); @@ -294,6 +303,7 @@ void createLegendRow(Context* ctx, lv_obj_t* parent, int index, int x, int y, in legendClicks[index] = LegendClick { ctx, index }; lv_obj_add_event_cb(row, onLegendClicked, LV_EVENT_CLICKED, &legendClicks[index]); lv_obj_add_event_cb(row, onLegendDraw, LV_EVENT_DRAW_POST, &legendClicks[index]); + lv_obj_add_event_cb(row, onLegendKey, LV_EVENT_KEY, nullptr); createMarkerImage(ctx, row, entry.slot); diff --git a/Apps/SatelliteTracker/main/Source/SatellitesView.cpp b/Apps/SatelliteTracker/main/Source/SatellitesView.cpp index a14ffebf..f1f56c5f 100644 --- a/Apps/SatelliteTracker/main/Source/SatellitesView.cpp +++ b/Apps/SatelliteTracker/main/Source/SatellitesView.cpp @@ -1,5 +1,6 @@ #include "SatelliteTracker.h" +#include #include #include @@ -239,6 +240,7 @@ void satellitesViewCreate(Context* ctx) { ctx->rowActions.push_back(RowAction { ctx, i, label }); addButton(row, LV_SYMBOL_EDIT, onRenameClicked, &ctx->rowActions.back()); addButton(row, LV_SYMBOL_TRASH, onRemoveClicked, &ctx->rowActions.back()); + lvgl_grid_navigation_add(row); } lv_obj_t* buttons = lv_obj_create(ctx->content); @@ -249,6 +251,7 @@ void satellitesViewCreate(Context* ctx) { lv_obj_set_style_pad_row(buttons, 4, 0); addButton(buttons, LV_SYMBOL_LIST " Add from group", onAddFromGroupClicked, ctx); addButton(buttons, LV_SYMBOL_DIRECTORY " Search", onSearchClicked, ctx); + lvgl_grid_navigation_add(buttons); if (ctx->statusText[0] != '\0') { addMessage(ctx, ctx->content, ctx->statusText); @@ -384,4 +387,5 @@ void renameViewCreate(Context* ctx) { lv_obj_set_style_pad_column(buttons, 8, 0); addButton(buttons, LV_SYMBOL_OK " Save", onRenameSave, ctx); if (entry.hasOrbit) addButton(buttons, LV_SYMBOL_REFRESH " Automatic", onRenameAuto, ctx); + lvgl_grid_navigation_add(buttons); } diff --git a/Apps/SatelliteTracker/manifest.properties b/Apps/SatelliteTracker/manifest.properties index 8aad8f71..61a2e227 100644 --- a/Apps/SatelliteTracker/manifest.properties +++ b/Apps/SatelliteTracker/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=all id=tactility.satellitetracker -version.name=0.8.0 -version.code=9 +version.name=0.9.0 +version.code=10 name=Satellite Tracker description.short=Live satellite world map description=World map with live satellite positions, their ground track, visibility footprint and the day and night areas. Predicts when satellites pass over your location.\n\nOrbit data comes from CelesTrak and positions are calculated on the device with SGP4.\n\nThe clock must be set, which happens once Wi-Fi has synced the time. Wi-Fi is needed to download orbit data. Downloaded data keeps working offline. diff --git a/Apps/TamaTac/main/Source/MainView.cpp b/Apps/TamaTac/main/Source/MainView.cpp index fb7fcc01..60fbf5c7 100644 --- a/Apps/TamaTac/main/Source/MainView.cpp +++ b/Apps/TamaTac/main/Source/MainView.cpp @@ -459,6 +459,14 @@ void mainViewRefitToFill(Context* ctx) { // across in one row, or 2+2 in two rows. Reparents only on mode change - // re-setting the same parent would reshuffle the order. contW <= 0 means // percent mode (small/medium/large tiers): full-width single row. +static void onActionKey(lv_event_t* event) { + lv_group_t* group = lv_obj_get_group(lv_event_get_current_target_obj(event)); + if (group == nullptr) return; + const uint32_t key = lv_event_get_key(event); + if (key == LV_KEY_RIGHT) lv_group_focus_next(group); + else if (key == LV_KEY_LEFT) lv_group_focus_prev(group); +} + void mainViewPlaceButtons(Context* ctx, bool twoRows, int bw, int contW) { MainViewState* state = &ctx->mainView; if (!state->btnRowTop || !state->btnRowBottom || !state->btnContainer || @@ -949,6 +957,8 @@ void mainViewCreateWidgets(lv_obj_t* parentWidget, Context* ctx) { } lv_obj_add_event_cb(*btn, callback, LV_EVENT_CLICKED, ctx); + // The buttons move between two rows with the layout, so they stay separate widgets in the group + lv_obj_add_event_cb(*btn, onActionKey, LV_EVENT_KEY, nullptr); }; createActionBtn(&state->feedBtn, "Feed", ICON_FEED, 7, onFeedClicked); diff --git a/Apps/TamaTac/main/Source/PatternGame.cpp b/Apps/TamaTac/main/Source/PatternGame.cpp index f85bc644..928afefe 100644 --- a/Apps/TamaTac/main/Source/PatternGame.cpp +++ b/Apps/TamaTac/main/Source/PatternGame.cpp @@ -7,6 +7,7 @@ #include "Layout.h" #include "TamaTac.h" #include "SfxEngine.h" +#include #include #include #include @@ -321,6 +322,8 @@ void patternGameCreateWidgets(lv_obj_t* parent, Context* ctx) { lv_obj_set_style_shadow_width(state->buttons[i], 0, 0); lv_obj_add_event_cb(state->buttons[i], onButtonClicked, LV_EVENT_CLICKED, ctx); } + lv_obj_set_style_outline_width(row, 0, LV_STATE_FOCUS_KEY); + lvgl_grid_navigation_add(row); } // Initialize game diff --git a/Apps/TamaTac/main/Source/SettingsView.cpp b/Apps/TamaTac/main/Source/SettingsView.cpp index 63304b0a..62c283b5 100644 --- a/Apps/TamaTac/main/Source/SettingsView.cpp +++ b/Apps/TamaTac/main/Source/SettingsView.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace { @@ -152,6 +153,8 @@ void settingsViewCreateWidgets(lv_obj_t* parentWidget, Context* ctx) { state->decayChips[i] = chip; } syncDecayChips(state, decaySpeed); + lv_obj_set_style_outline_width(chips, 0, LV_STATE_FOCUS_KEY); + lvgl_grid_navigation_add(chips); } void settingsViewStop(Context* ctx) { diff --git a/Apps/TamaTac/manifest.properties b/Apps/TamaTac/manifest.properties index 73ac8c2a..028c6a8b 100644 --- a/Apps/TamaTac/manifest.properties +++ b/Apps/TamaTac/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=all id=tactility.tamatac -version.name=0.26.0 -version.code=26 +version.name=0.27.0 +version.code=27 requires.ram=2M name=TamaTac description.short=Tamagotchi-style virtual pet diff --git a/Apps/Tone/main/Source/ToneUi.cpp b/Apps/Tone/main/Source/ToneUi.cpp index 9b20a1a7..35fa5655 100644 --- a/Apps/Tone/main/Source/ToneUi.cpp +++ b/Apps/Tone/main/Source/ToneUi.cpp @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -496,6 +497,9 @@ void createReadout(Context* ctx, lv_obj_t* parent, int32_t gap) { lv_obj_set_style_text_opa(ctx->statusLabel, LV_OPA_70, 0); createStepButton(ctx, row, LV_SYMBOL_PLUS, onHigher); + lv_obj_set_style_outline_width(texts, 2, LV_STATE_FOCUS_KEY); + lv_obj_set_style_outline_color(texts, lv_theme_get_color_primary(texts), LV_STATE_FOCUS_KEY); + lvgl_grid_navigation_add(row); } lv_obj_t* createSlider(Context* ctx, lv_obj_t* parent, int32_t min, int32_t max, lv_event_cb_t callback) { @@ -543,6 +547,7 @@ void createWaveforms(Context* ctx, lv_obj_t* parent, int32_t gap) { for (uint32_t i = 0; i < TONE_WAVEFORM_COUNT; i++) { ctx->waveformChips[i] = createChip(ctx, row, tr(WAVEFORM_NAMES[i]), i, onWaveformPressed); } + lvgl_grid_navigation_add(row); if (isWrapped(ctx, row)) { lv_obj_set_style_pad_column(row, 2, 0); for (auto* chip : ctx->waveformChips) { @@ -563,6 +568,7 @@ lv_obj_t* createPresets(Context* ctx, lv_obj_t* parent, int32_t gap) { lv_obj_set_flex_grow(ctx->presetChips[j], 1); } fitGrowingChips(row, &ctx->presetChips[i], 4, gap); + lvgl_grid_navigation_add(row); } return card; } @@ -576,6 +582,7 @@ void createSweep(Context* ctx, lv_obj_t* parent, int32_t gap) { lv_obj_set_flex_grow(ctx->sweepChip, 1); lv_obj_t* modeChips[] = { ctx->fixedChip, ctx->sweepChip }; fitGrowingChips(modes, modeChips, 2, gap); + lvgl_grid_navigation_add(modes); for (uint32_t i = 0; i < 3; i++) { auto* row = createBox(card, LV_FLEX_FLOW_ROW, gap + 8); diff --git a/Apps/Tone/manifest.properties b/Apps/Tone/manifest.properties index 48e91fbb..81dd5e2f 100644 --- a/Apps/Tone/manifest.properties +++ b/Apps/Tone/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=all id=tactility.tone -version.name=0.10.0 -version.code=10 +version.name=0.11.0 +version.code=11 name=Tone description.short=Tone and frequency sweep tool description=Signal generator that plays tones straight to the audio codec.\n\nFive waveforms (sine, square, sawtooth, triangle and noise that is darker at low frequencies), eight frequency presets from 50 Hz to 10 kHz or a free frequency entry, a triangle frequency sweep with adjustable range and period, and a volume slider. Changes apply immediately while playing. diff --git a/Apps/WebBrowser/main/Source/Browser.cpp b/Apps/WebBrowser/main/Source/Browser.cpp index 835fcd2f..0b5d5b48 100644 --- a/Apps/WebBrowser/main/Source/Browser.cpp +++ b/Apps/WebBrowser/main/Source/Browser.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -763,6 +764,17 @@ lv_obj_t* createHeaderButton(Context* ctx, lv_obj_t* parent, const char* symbol, return button; } +/** A row of header buttons that the arrow keys move along */ +lv_obj_t* createHeaderGroup(lv_obj_t* parent, int32_t spacing) { + lv_obj_t* group = lv_obj_create(parent); + lv_obj_remove_style_all(group); + lv_obj_set_size(group, LV_SIZE_CONTENT, LV_SIZE_CONTENT); + lv_obj_set_flex_flow(group, LV_FLEX_FLOW_ROW); + lv_obj_set_style_pad_column(group, spacing, 0); + lvgl_grid_navigation_add(group); + return group; +} + } void browserInit(Context* ctx, const std::string& url) { @@ -895,7 +907,7 @@ void createBrowserScreen(Context* ctx, lv_obj_t* parent) { lv_obj_set_style_pad_right(header, spacing, 0); lv_obj_set_style_pad_column(header, spacing, 0); - createHeaderButton(ctx, header, LV_SYMBOL_CLOSE, onExit); + createHeaderButton(ctx, createHeaderGroup(header, spacing), LV_SYMBOL_CLOSE, onExit); ctx->address = lv_textarea_create(header); lv_textarea_set_one_line(ctx->address, true); @@ -909,9 +921,10 @@ void createBrowserScreen(Context* ctx, lv_obj_t* parent) { lv_obj_add_event_cb(ctx->address, onAddressDefocused, LV_EVENT_DEFOCUSED, ctx); ctx->addressText.clear(); - ctx->back = createHeaderButton(ctx, header, LV_SYMBOL_LEFT, onBack); - ctx->forward = createHeaderButton(ctx, header, LV_SYMBOL_RIGHT, onForward); - createHeaderButton(ctx, header, LV_SYMBOL_BARS, onOverflow); + lv_obj_t* actions = createHeaderGroup(header, spacing); + ctx->back = createHeaderButton(ctx, actions, LV_SYMBOL_LEFT, onBack); + ctx->forward = createHeaderButton(ctx, actions, LV_SYMBOL_RIGHT, onForward); + createHeaderButton(ctx, actions, LV_SYMBOL_BARS, onOverflow); createPageView(ctx, parent); lv_obj_set_style_pad_left(ctx->status, spacing, 0); @@ -1083,6 +1096,8 @@ void createWarningScreen(Context* ctx, lv_obj_t* parent) { lv_obj_t* accept = lv_button_create(buttons); lv_label_set_text(lv_label_create(accept), tr("I accept")); lv_obj_add_event_cb(accept, onWarningAccepted, LV_EVENT_SHORT_CLICKED, ctx); + lvgl_grid_navigation_add(buttons); + lvgl_grid_navigation_focus_without_touch(buttons, exit); // Keys can only scroll what has the focus: a long text is added after the buttons, so that "Exit" keeps it lv_obj_update_layout(parent); diff --git a/Apps/WebBrowser/manifest.properties b/Apps/WebBrowser/manifest.properties index 8f592a1f..8d46b432 100644 --- a/Apps/WebBrowser/manifest.properties +++ b/Apps/WebBrowser/manifest.properties @@ -2,8 +2,8 @@ manifest.version=0.3 target.sdk=0.8.0-dev target.platforms=esp32,esp32s3,esp32c6,esp32p4,esp32s31,linux-x86_64 id=tactility.webbrowser -version.name=0.2.0 -version.code=2 +version.name=0.3.0 +version.code=3 name=Web Browser description.short=Text-first web browser description=Reads web pages as text, with selectable links, history and a cache. Simple search and filter forms work. No CSS, JavaScript or cookies. HTTPS certificates are verified with the certificates of the device. Built on top of the Lexbor engine.