Skip to content

Refresh botui's touchscreen UI - #155

Open
objorkman wants to merge 9 commits into
thomas/waylandfrom
oscar/theme
Open

objorkman wants to merge 9 commits into
thomas/waylandfrom
oscar/theme

Conversation

@objorkman

@objorkman objorkman commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #154 (Wayland), so its base is thomas/wayland and the diff shows only this work. Review #154 first.

This brings botui's look and touch layout on the Wombat's 800×480 screen in line with the mockup, one commit per area. Every screen reachable from Home is restyled. Behavior stays the same except where noted below.

What changed

Theme

  • Qt's Fusion style, an app palette, and one style sheet, rc/style/botui.qss, replace MechanicalStyle. Controls are white with dark text, blue marks what's selected or the main action, green marks what's on, and red marks stop and delete. The header is black, and scroll bars are wide enough for a finger. The colors were checked for contrast under bright light and for red-green color blindness.
  • Atkinson Hyperlegible Next and Mono (SIL OFL) replace the bundled DejaVu fonts. The style sheet sets the family on every widget, because the .ui files name fonts the Wombat doesn't have.
  • MenuBar's StopButtonWidget was created but never added to a layout, so it never showed. It's deleted along with MechanicalStyle.

Battery level

  • Thomas, a heads-up: 62715f2 ("Remove old audio stuff") also removed the battery level and the Battery button in Advanced settings, which sets the battery type the level is computed for. This restores WombatBatteryProvider, BatteryLevelProvider and BatterySettingsWidget as they were before that commit, so the header can show the level again. The low-battery sound stays out. How the level is computed can be revisited in a later PR.

Header and home screen

  • Every screen's header has Home and Back (Back is named after the screen it returns to), the title, Wi-Fi status, the battery level, the screen's own actions, and a red Stop while a program runs.
  • While a program runs, other screens show a pill with its name and run time that opens it. On the program's own screen the header shows Running, Stopped, Exit code N or Crashed, and Stop becomes a green Run again. The console says how the program ended, with the signal's name for a crash.
  • StatusBar is deleted; the header shows the network status and Event Mode it held.
  • Home is a 2×2 grid of tiles with a Wi-Fi card: the network name, password and IP address in access point mode, the network and IP address in client mode, or that Wi-Fi is off or Event Mode is on. About and Power are icons in the header, and Power offers Shut Down and Reboot in one dialog.
  • NetworkManager no longer uses a missing Wi-Fi device when asked for the active connection's state, name or IP address. Files gets Home and Back in place of its Exit button.

Dialogs

  • Every dialog is a MessageDialog, shown inside botui's window over the dimmed screen and under the keyboard, instead of a separate window the compositor places: a title and text over Cancel and an action, OK alone, tiles to choose from, or a spinner while something finishes. Tapping outside a dialog cancels it, except a busy one. AreYouSureDialog and NotYetImplementedDialog are deleted.
  • Shut Down and Reboot show "Shutting down…" or "Rebooting…" for two seconds before running the command. Switching Event Mode or the Wi-Fi band shows a spinner until it's done. Dialog text says what will happen.

The remaining screens

  • Programs, Files, Motors & Sensors, Settings, Network, About, and the keyboard and number pad are built from shared pieces rather than per-screen widgets: white cards of setting or info rows, tiles, segmented controls (UiStandards::setUpSegments()), and icons in a button's text color (setButtonIcon()). A new ListDelegate draws every list and replaces the per-screen item delegates. AGENTS.md describes the shared styles.
  • The keyboard and number pad are built in code and open over the dimmed screen. The keyboard has letter, number and symbol layers. On the number pad the first key replaces the value, backspace and ± replace Clear, and an out-of-range value shows an error instead of being accepted.
  • A tap on a slider's track moves the handle there instead of stepping toward the tap.

Behavior changes to look at:

  • Sensor Graph: it used the Kovan port mapping, because the Wombat's was under #ifdef WALLABY, which nothing defines. Back EMF and the accelerometer read the wrong sensors, the gyroscope and magnetometer read 0, and analog values were scaled for 0–512. It now uses the Wombat's mapping.
  • Motors: one slider with step buttons, in Power or Velocity. Forward and Backward stay as Power's outer steps, changing mode still stops the motor, and each port shows what it's set to. A motor keeps running when another port is selected. Clear Position moves from the header into the screen.
  • Servos: a slider with step and Center buttons and an Enabled switch. Its number pad accepts 0–2047.
  • Programs: shows when the selected program was last built, from the file's date, and selects the first program when none is selected.
  • Files: Up moves into the column of actions and works without a selection; Delete is disabled until something is selected. A double tap opens a folder, as Open does, while a single tap still selects it for Delete. The path starts at KISS, the folder the KIPR IDE shows, instead of /home/kipr. Folders no longer have a chevron.
  • Camera channels: Add a channel is a dialog with two choices, so CreateChannelDialog is deleted. The default configuration is labeled "Default" instead of starred. The HSV screen has the standard header, with Back to Channels and the channel's name. The HSV picker's handles are small dots instead of circles that grew with the picker and hid the selection, and a tap grabs the nearest handle, because Saturation's and Value's top-left handles overlap near the top of their range.
  • Network: mode, band and Other network's security are segmented controls, and changing the mode asks first. While Event Mode is on, the mode is hidden and isn't changed.
  • Program no longer connects to a readyRead() signal it doesn't have, so Wayland support #154's No such signal warning is gone.

Fixes from a design review

  • Deleting a camera configuration or a channel, forgetting a saved network, setting the serial number, and reflashing the STM32 now ask first and say what will change. Remove is renamed Delete.
  • Changing the Wi-Fi mode asks first, warns when leaving access point mode will disconnect laptops, and shows a spinner while it switches. When the screen updates the mode to follow Wi-Fi's actual state, it still doesn't ask, as before.
  • Set serial number stays disabled until all four fields are filled. Forget and Install stay disabled until something is selected.
  • An empty list says what would be there or how to fill it: Join a network, Saved networks and Update. Network and About hide info rows that have no value, and About shows Wi-Fi as "Not connected" instead of 0.0.0.0.
  • After a program ends, Stop stays in place, dimmed, for 1.5 seconds before Run again replaces it. Stopping blocks the touchscreen while the program exits, so a second tap on Stop could otherwise land on Run again. Stop is now as wide as Run again.
  • Motors has an engine icon and Servos a gears icon, replacing icons that looked like refresh and sliders. The engine is botui's own, in rc/icons/botui/, which UiStandards::icon() checks before Font Awesome. A motor port's detail turns green while it runs, and a servo port's while it's enabled.
  • Smaller fixes: text fields are at least 40px tall; keyboard keys and Programs' columns are 8px apart; a filled tile's description, the crash label and the field hint take the theme's colors; Invert screen is no longer red; and Battery's field reads "Warn at (%)".

Cleanup

  • Classes, forms and images that nothing used are deleted: the first-run and test wizards, the PID tuner, pairing, accessories, the old Motors screen, the Kovan settings screens, the lock and loading QML screens, the five FileAction classes nothing registered, the old PNG icon set, and Font Awesome's brand icons. Nothing changes on screen, and the binary shrinks from 7.0 to 5.0 MB.
  • AGENTS.md's Legacy code section now lists what's still unreached but kept: the disabled compile path, program arguments, FileActions, and presentQml() with DeclarativeView.

Not restyled

  • Wayland support #154's touch calibration and screen orientation pages keep their own look. In the container both stop at an error because there's no labwc or kanshi config, so I haven't seen them working.
  • Program arguments, which nothing opens because its button is hidden.

Found, not fixed

  • Update: if mounting the USB drive fails, Refresh, Install and Update online all stay disabled until you leave the screen. This happened before this PR too.

Verification

  • Built in Docker on Wayland support #154's Debian 13 image after each commit: no warnings, and Wayland support #154's unit tests pass. The battery commit also builds on its own. The last two commits were also built from a clean build/.
  • Ran botui under Xvfb with scripts/screenshot.sh and compared 43 screens with this PR's base, from Home through Programs, Files, Motors & Sensors, Settings, Advanced, Network, the keyboard and the number pad. The base build crashes on Network settings in the container, so those screens have no before. The new confirmations and empty lists were checked the same way. In the container there's no NetworkManager, so Wi-Fi always reads off, and the Network screen switches client mode back to Off at its next update, as the base does. For the header, also ran a program that runs, is stopped and run again, exits with code 1, and segfaults. The logs have no style sheet errors and no signal or slot warnings. After the cleanup, 64 screenshots across Programs, a running program, Motors & Sensors, Files, the HSV screen, Network and Settings match the ones taken before it, apart from build times and run timing, and the logs are unchanged.
  • Not tested on a Wombat yet. To check on the real screen:
    • Fonts, colors and touch sizes under classroom and gym lighting, including whether the header's dark buttons stand out from the black bar.
    • The battery level against a real battery, and that changing the battery type changes it.
    • The Wi-Fi card and Network screen in access point and client mode, switching the band on a 3B+, and Event Mode on and off.
    • Each Wi-Fi mode change through its confirmation, and that the chosen mode stays chosen.
    • Motors in Power and Velocity, Servos, the Sensor Graph's ports and the Sensor List against real sensors.
    • The HSV picker's handles with a finger.
    • Power → Shut Down and Reboot, Update, Backup, and Factory tools, including the Set serial number and Reflash confirmations.
    • Stop and Run again with a real program, including a quick second tap on Stop.
    • A double tap on a folder in Files with a finger.

Screenshots

At 800×480, before (this PR's base) on the left and after on the right, from the Docker build on a virtual display. There's no hardware there, so the battery reads 0%, Wi-Fi is off, and versions show ??. The images are in a gist.

Home and header (4 screens)

Home

Home, before and after

Power: Before had separate Shut Down and Reboot buttons in the header, each with its own confirmation; Power now offers both in one dialog.

Power, before and after

About: Wi-Fi reads Not connected instead of 0.0.0.0, and rows with no value are hidden.

About, before and after

Developers

Developers, before and after

Programs (4 screens)

Programs

Programs, before and after

Program running

Program running, before and after

Program stopped: Stop now stays in place, dimmed, for 1.5 seconds after the program ends, so a second tap on Stop doesn't land on Run again.

Program stopped, before and after

Editor

Editor, before and after

Files (3 screens)

Files: The path now starts at KISS, the folder the KIPR IDE shows, rather than the full /home/kipr path.

Files, before and after

Project folders: A tap selects a folder for Delete; a double tap or Open goes into it.

Project folders, before and after

Inside a project

Inside a project, before and after

Motors & Sensors (6 screens)

Motors & Sensors: Motors has an engine icon and Servos two gears, in place of the refresh and sliders icons.

Motors & Sensors, before and after

Motors: A port's detail turns green while its motor is running.

Motors, before and after

Servos: A port's detail turns green while its servo is on.

Servos, before and after

Sensor Graph

Sensor Graph, before and after

Sensor List

Sensor List, before and after

Camera: No camera in the container, so both show an empty view.

Camera, before and after

Settings (13 screens)

Settings

Settings, before and after

Camera view

Camera view, before and after

Camera channels

Camera channels, before and after

Delete a configuration: New: Delete asks first. Before, Remove deleted the file at once.

Delete a configuration, before and after

Channels

Channels, before and after

Delete a channel: New: Delete asks first, and says the channels after it move up.

Delete a channel, before and after

HSV, visual: The HSV screen now has the standard header, with Back to Channels and the channel's name. The handles are smaller.

HSV, visual, before and after

HSV, manual

HSV, manual, before and after

Add a channel: The separate Create Channel dialog is replaced by a dialog with option tiles.

Add a channel, before and after

Language

Language, before and after

Update, no USB drive

Update, no USB drive, before and after

Update: With no update file, the list says what to do, and Install stays off until a file is selected.

Update, before and after

Backup

Backup, before and after

Advanced (5 screens)

Advanced

Advanced, before and after

Display

Display, before and after

Battery: The PR's base had removed this screen; this PR restores it.

Battery, before and after

Factory tools: Set serial number stays off until all four fields are filled, and both it and Reflash ask first.

Factory tools, before and after

Reflash confirmation: New: Reflash asks first and says what stops working meanwhile. Before, it started at once.

Reflash confirmation, before and after

Network (6 screens)

Network: The base build crashes on this screen in the container, so there's no before for the Network screens. The Status card hides rows that have no value.

Network, before and after

Switch Wi-Fi mode: New: changing the Wi-Fi mode asks first. Leaving access point mode also warns that connected laptops will disconnect.

Switch Wi-Fi mode, before and after

Network, Client mode

Network, Client mode, before and after

Join a network: With no networks found, the list says what to do.

Join a network, before and after

Other network

Other network, before and after

Saved networks: With no saved networks, the list says so, and Forget stays off until a network is selected.

Saved networks, before and after

Text entry (2 screens)

Keyboard

Keyboard, before and after

Number pad

Number pad, before and after

botui drew its own widgets with MechanicalStyle, whose gray gradient
buttons and light type are hard to read on the Wombat's screen under gym
lighting. It now uses Qt's Fusion style with an app palette and one
style sheet, rc/style/botui.qss: white controls with dark text, blue for
selected or main actions, green for on, a black header, and scroll bars
wide enough for a finger. The colors were checked for contrast and
red-green color blindness.

The bundled DejaVu fonts give way to Atkinson Hyperlegible Next and Mono
(SIL OFL). The style sheet sets the family on every widget, because the
.ui files name fonts the Wombat doesn't have.

MenuBar's StopButtonWidget was created but never added to a layout, so
it never showed; it's deleted along with MechanicalStyle. The Sensor
List's inline scroll bar style and MenuBar's inline font size give way
to the style sheet. The image switches on About and Network settings
keep their size.
62715f2 ("Remove old audio stuff") removed the low-battery sound and,
with it, the battery level in the status bar and the Battery button in
Advanced settings, which sets the battery type the level is computed
for. WombatBatteryProvider, BatteryLevelProvider and
BatterySettingsWidget are restored as they were before that commit, and
Device provides the battery level again. The settings screen's title is
now "Battery". The next commit shows the level in the header. The
low-battery sound stays out.
The header now follows the mockup on every screen: Home and Back, with
Back named after the screen it returns to, the title, Wi-Fi status and
the battery level, the screen's own actions, and a red Stop while a
program runs. Its buttons are a dark fill on the black bar, without the
outline the theme gave them. On other screens a pill with the running
program's name and run time opens it. On the program's own screen the
header says whether it's running, was stopped, exited with an error
code, or crashed, and Stop becomes a green Run again. Program keeps the
last program's name, run time and how it ended for this.

The status bar at the bottom of each screen held the network status and
the Event Mode label, which the header now shows, so StatusBar is
deleted along with the global that tracked Event Mode for it. The header
and Home's Wi-Fi card read the mode from its file each time they're
shown.

Home is a 2x2 grid of large tiles with a Wi-Fi card under them that
shows the network name, password and IP address, or that Wi-Fi is off
or Event Mode is on. About and Power are icons in the header, and Power
offers Shut Down and Reboot in one dialog instead of two header buttons
that each asked again.

NetworkManager no longer uses a missing Wi-Fi device when asked for the
active connection's state, name or IP address. Files gets Home and Back
in place of its Exit button, and the programs list passes the
project's name rather than its path. Two titles lose "Widget", and
Motors & Sensors is titled like its tile. AGENTS.md has the new tap
coordinates and describes the header.
Dialogs were separate windows: QMessageBox in some places,
AreYouSureDialog and NotYetImplementedDialog in others, each styled its
own way, and placed wherever the compositor put them. Every one is now a
MessageDialog, centered over the dimmed screen inside botui's window and
under the keyboard. It shows a title and text over Cancel and an action,
OK alone, tiles to choose from, or a spinner while something finishes.
Tapping outside a dialog cancels it, except a busy one.
AreYouSureDialog and NotYetImplementedDialog are deleted.

RootWindow gets a dialog layer between the pages and the input overlay,
with the scrim drawn by the style sheet. presentDialog() makes the
dialog a child of that layer and waits on a local event loop instead of
exec(), whose modality only applies to windows, then gives the dialog
back its parent.

Buttons take a variant property for the main action (primary), stopping
or deleting (danger), and starting a program (run); the header's Stop
and Run again use it. UiStandards::setUpTile() builds the row tiles on
Home and the column tiles in dialogs, replacing Home's own helper.

Shut Down and Reboot show "Shutting down…" or "Rebooting…" for two
seconds before running the command. Switching Event Mode or the Wi-Fi
band shows a spinner until it's done, and the band switch now closes it
when NetworkManager reports any band change. Dialog text is rewritten
to say what will happen. AGENTS.md describes MessageDialog and the
shared button and tile styles.
Programs, Files, Motors & Sensors, Settings, Network, About, and the
keyboard and number pad now follow the mockup, built from shared pieces
rather than per-screen widgets. Screens hold their content in white
cards of setting or info rows. Choices such as a motor port, the battery
type or the Wi-Fi mode are segmented controls made by
UiStandards::setUpSegments(), and buttons get icons in their text color
from setButtonIcon(). Settings, Advanced and Motors & Sensors are grids
of tiles. Every list is drawn by the new ListDelegate: an icon, the
item's name, a detail line such as a program's user or a network's
security, and a chevron on folders. It replaces the item delegates that
Programs, Camera channels and Channels each had. The style sheet gains
the card, row and text roles, the segmented control, a destructive
variant for red-text actions such as Delete, and the keyboard and
number pad.

The keyboard and number pad are built in code, so their .ui files are
deleted, and they open over the dimmed screen like a dialog. The
keyboard has letter, number and symbol layers with Done and Cancel. The
number pad replaces the value with the first key, has backspace and a
sign key in place of Clear, and says when a value is out of range
instead of taking it. KeyButton is a plain QPushButton that never takes
focus.

Motors drives the selected port with one slider and step buttons, in
Power or Velocity. Forward and Backward stay as Power's outer steps,
changing mode still stops the motor, and each port shows what it's set
to. Clear Position moves from the header into the card. Servos replaces
the dial with a slider, step and Center buttons, and an Enabled switch,
and its number pad is limited to 0-2047. A tap on a slider's track now
moves the handle there, through a proxy of the Fusion style.

Programs shows the selected program in a card with Run and Edit, and
when it was last built; the first program is selected when none is.
Files moves Up into its column of actions, where it works without a
selection, disables Delete until something is selected, and shows the
path. The editor gets Home and Back, with its actions in a toolbar.

Add a channel is a MessageDialog with option tiles, so
CreateChannelDialog is deleted. The default channel configuration is
marked "Default" rather than with a star. Display, Battery, Update,
Backup, Factory tools and Language are cards; Update and Backup hide
their status label until something runs, and a field too narrow for
"Tap to Edit..." is left empty. Network's mode and band and Other
network's security are segmented controls, and setMode() leaves the
mode alone while Event Mode hides it. About shows "© year KIPR", and the
developers are a grid. Several titles are shorter, such as "Camera view"
and "Saved networks".

The sensor graph used the Kovan mapping, because the Wombat's was under
#ifdef WALLABY, which nothing defines: Back EMF and the accelerometer
read the wrong sensors, the gyroscope and magnetometer read 0, and
analog values were scaled for 0-512. It now uses the Wombat's mapping.
Program no longer connects to a readyRead() signal it doesn't have.
AGENTS.md describes the shared roles and ListDelegate, and drops the
Network screen from the container's crashes, which 53c8e4c fixed.
The handles scaled with the picker, to a radius of about 33px and twice
that while dragged, so on the restyled HSV screen they hid the selection
they adjust. They're now drawn as small dots, and a tap within 22px of
one still grabs it.
Fixes from a design review of the restyled screens.

Stopping a program blocks the touchscreen while it exits, and taps made
meanwhile land afterwards. Stop now stays in place, disabled, for 1.5
seconds after the program ends, so a second tap can't hit Run again.
Stop is now as wide as Run again, which takes its place.

Deleting a camera configuration or a channel, forgetting a saved
network, setting the serial number and reflashing the STM32 now ask
first, naming what will change; Remove is renamed Delete. Changing the
Wi-Fi mode asks too, warns when leaving access point mode will
disconnect laptops, and switches under a spinner. setMode(), which
follows Wi-Fi's state, still changes the mode without asking. Set serial
number stays disabled until all four fields are filled, since
wallaby_set_serial.sh takes all four, and Forget and Install until
something is selected.

UiStandards::setEmptyText() puts a line in an empty list that says what
would be there or how to fill it, on Join a network, Saved networks and
Update. hideBlankInfoRows() hides a card's info rows with no value, such
as the password while Wi-Fi is off, on Network and About. About shows
Wi-Fi as "Not connected" instead of 0.0.0.0.

Files opens a folder on a double tap as well as with Open; a tap still
selects it, for Delete. Its path starts at KISS, the folder the KIPR IDE
shows, instead of /home/kipr. ListDelegate no longer draws a chevron on
folders.

The HSV screen is a StandardWidget with the standard header, Back to
Channels and the channel's name, so ChannelConfigWidget and its factory
take the Device. A tap grabs the nearest handle in reach, because
Saturation's and Value's top-left handles meet as their maximums near
255 and Value's couldn't be grabbed.

Motors has an engine icon and Servos two gears, in place of icons that
read as refresh and sliders. The engine is botui's own, in
rc/icons/botui/, which UiStandards::icon() checks before Font Awesome. A
motor port's detail turns green while it runs, and a servo's while it's
enabled. Text fields are at least 40px tall; keyboard keys and Programs'
columns are 8px apart; a filled tile's description, the crash label and
the field hint take the theme's colors; Invert screen is no longer red;
and Battery's field reads "Warn at (%)". AGENTS.md describes the new
helpers and botui's own icons.
Nothing changes on screen. The deleted classes were compiled but never
shown or instantiated: the first-run and test wizards and their pages,
PairWidget, PidTunerWidget and PidWidget, AccessoriesWidget,
CreateWidget, MotorsWidget, TouchDial, KissIdeSettingsWidget,
ChannelSettingsWidget, NetworkStatusWidget, UnderConstructionWidget,
TimeWidget, CompilingWidget, ProcessLogDialog, SerialIODevice,
ConfigurationPaths, CameraInputManager and CameraInputModel, and the
five FileAction subclasses, which nothing registers. Their forms go
with them, along with five forms no class builds, two Qt Designer
.autosave files and a committed vim swap file.

The lock screen is gone, with BusyIndicator and rc/qml/: its menu action
was already commented out, and nothing loaded the loading screen.
RootController::presentQml() and DeclarativeView stay, still unused.

The resources drop the 1,025 PNG icons, which only MotorsWidget and
PidWidget used, the Font Awesome brands set, and the tango and
construction images, so the binary shrinks from 7.0 to 5.0 MB.
UiStandards loses lockString() and stopString(), which had no callers.
AGENTS.md's Legacy code section now lists the code that's still kept but
unreached, instead of the deleted classes and three that never existed.
@objorkman
objorkman marked this pull request as ready for review November 29, 2026 22:37
@objorkman
objorkman requested a review from twells46 November 29, 2026 22:37
The image built libwallaby v1.2.1, which predates libwallaby's Debian 13
port and still has the Create API that this branch removed from botui, so
botui was never built against the libwallaby it will ship with. Pin the
current master commit instead, fetched by hash since git clone --branch
can't take one.

Master already builds libav with GCC 14's pointer-type errors turned back
into warnings, so only the assembly workaround stays. Master also packages
a .deb after every build, which the image doesn't need.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant