Skip to content

linux: redesign UI with iOS dark theme and new features - #840

Closed
GoathierS wants to merge 2 commits into
librepods-org:mainfrom
GoathierS:linux/ui-redesign-ios-theme
Closed

GoathierS wants to merge 2 commits into
librepods-org:mainfrom
GoathierS:linux/ui-redesign-ios-theme

Conversation

@GoathierS

@GoathierS GoathierS commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

Complete overhaul of the Linux client UI with an iOS-inspired dark theme, plus several quality-of-life features and bug fixes.

New QML components

  • BatteryRing.qml — animated Canvas arc showing battery %, charging indicator (⚡), and unknown state (—)
  • IOSSwitch.qml — iOS-style toggle switch with containsMouse exposed for tooltips, uses signal toggled() to avoid binding breaks
  • CaseOpenPopup.qml — slide-in popup anchored to the top-right corner of the main window's screen, draggable, 5s auto-close progress bar that pauses on hover, displays AirPod model image and charging state. Only shown for your own AirPods

UI improvements

  • Frameless window with fixed header outside StackView so drag works correctly
  • Adaptive height: 310px when disconnected, 540px when connected (smooth animation)
  • Escape key closes window (via Shortcut); window position persisted across sessions (debounced)
  • Pod images (per model) and battery rings for left, right, and case

New C++ features

  • autoSwitchEnabled — while Linux is playing audio, take over the AirPods as soon as BLE shows they are free (attempts rate-limited to one every 15 s). The existing take-over when playback starts is unchanged
  • bleAirPodsElsewhere — detects via BLE if the AirPods are active on another device (only for our own device, matched via IRK, so nearby strangers' AirPods are ignored)
  • takeOverAudio() Q_INVOKABLE — manual take-over button in the UI
  • saveWindowPos / savedWindowPos — window position persisted via QSettings

Bug fixes

  • BLE battery nibble values 11–14 were multiplying to 110–140%; capped to 100%
  • Bluetooth address now persisted in QSettings
  • RSSI filter: ignore very weak BLE advertisements (< −80 dBm)
  • BLE scan restarts only when it was not stopped on purpose; errors are retried with exponential backoff
  • Font.SemiBold → Font.DemiBold (SemiBold is undefined in Qt Quick)
  • Image paths corrected to qrc:/icons/assets/ prefix
  • isEmpty() guards added before all .first() calls on rootObjects() / topLevelWindows() to prevent ASSERT crash

Test plan

  • Build on Ubuntu 24.04 with Qt 6.4: cmake .. && make -j$(nproc) in linux/build/
  • Connect AirPods and verify battery rings display correctly (including charging state and unknown —)
  • Open lid → popup appears top-right, slides in, auto-closes after 5s, pauses on hover
  • Drag both main window and popup
  • Verify window position is remembered after restart
  • Test auto-switch: start playing audio on Linux with AirPods connected elsewhere

Complete overhaul of the Linux client UI with an iOS-inspired dark theme,
plus several quality-of-life features and bug fixes.

New QML components:
- BatteryRing.qml: animated Canvas arc with charging indicator and unknown state (—)
- IOSSwitch.qml: iOS-style toggle with containsMouse exposed for tooltips
- CaseOpenPopup.qml: slide-in popup (top-right corner), drag support, 5s auto-close
  progress bar that pauses on hover, model image

UI improvements (Main.qml / PodColumn.qml):
- Frameless window with fixed header outside StackView for drag support
- Adaptive height 310px (disconnected) / 540px (connected) with smooth animation
- Escape key closes window; window position persisted via QSettings
- Pod images and battery rings per ear/case

New C++ features (main.cpp):
- autoSwitchEnabled: automatically connect when Linux starts playing audio
- bleAirPodsElsewhere: detect via BLE if AirPods are active on another device
- takeOverAudio() Q_INVOKABLE: manual take-over button
- saveWindowPos / savedWindowPos: persist window position across sessions
- isEmpty() guards on all rootObjects/topLevelWindows to prevent ASSERT crash

Bug fixes:
- BLE battery nibble values 11-14 capped to 100% (were showing 110-140%)
- Bluetooth address now persisted in QSettings (deviceinfo.hpp)
- RSSI filter: ignore devices further than ~10m (< -60 dBm)
- Font.SemiBold replaced with Font.DemiBold (not defined in Qt Quick)
- Image paths corrected to qrc:/icons/assets/ prefix
- Only react to our own AirPods (IRK match) for the "in use elsewhere"
  state and the case lid popup; the previous fallback matched any nearby
  Apple device
- Rate-limit auto-switch connection attempts (blocking bluetoothctl call
  was triggered on every BLE packet, freezing the UI)
- Restore previous media-playing behaviour (always take over audio);
  autoSwitchEnabled only controls the extra BLE-based take-over
- Relax RSSI filter to -80 dBm so our own AirPods' BLE battery updates
  are not dropped at a few metres
- Only restart the BLE scan when it was not stopped on purpose; retry
  errors with exponential backoff and skip when the adapter is off
- Replace Keys.onEscapePressed (cannot attach to a Window) with a Shortcut
- Debounce window position saving instead of writing on every pixel
- Popup: show real charging state, open on the main window's screen,
  use a TapHandler so it does not steal the drag
- IOSSwitch: use Item's built-in enabled instead of shadowing it
- Remove per-packet raw BLE debug log, translate comments to English
@GoathierS
GoathierS force-pushed the linux/ui-redesign-ios-theme branch from a33ff48 to 37c7615 Compare October 14, 2026 07:45
@kavishdevar

Copy link
Copy Markdown
Member

QT version is not being maintained. check #241

@GoathierS

Copy link
Copy Markdown
Author

Thanks for the pointer, I misread it as a Qt version issue at first. Understood that the Qt client is being replaced by the Rust/iced app in #241. I'll leave this closed. Would you be interested in some of these features (iOS-style battery rings, case-open popup, auto-switch behaviour) being contributed to the Rust app once it lands on main, or is the UI there still in flux?

@kavishdevar

Copy link
Copy Markdown
Member

UI there still in flux

Very much so. I actually will be getting rid of the UI entirely and expose everything over dbus, to have separate frontends in whatever UI frameworks people would want. Thanks anyway!

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.

2 participants