Skip to content

Add frameless support to audio device dialog#2618

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
rfoust:codex/audio-detected-frameless
May 13, 2026
Merged

Add frameless support to audio device dialog#2618
ten9876 merged 1 commit into
aethersdr:mainfrom
rfoust:codex/audio-detected-frameless

Conversation

@rfoust

@rfoust rfoust commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add frameless window support to the Audio Device Detected dialog using the existing FramelessWindowTitleBar and FramelessResizer helpers.
  • Read the global FramelessWindow AppSettings value so the dialog follows the same chrome preference as other windows.
  • Remove the dialog-specific show-time centering logic so first-show placement follows the same Qt/window-manager behavior as NetworkDiagnosticsDialog, while runtime frameless toggles preserve geometry only when already visible.

Testing

  • cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
  • cmake --build build

Copilot AI review requested due to automatic review settings May 13, 2026 03:59
@rfoust rfoust requested review from jensenpat and ten9876 as code owners May 13, 2026 03:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Audio Device Detected dialog to support the app’s frameless-window mode, aligning its window chrome behavior with other dialogs/windows that already use the shared frameless helpers.

Changes:

  • Add a FramelessWindowTitleBar to the dialog and wire up FramelessResizer for edge resizing in frameless mode.
  • Read the global AppSettings("FramelessWindow") preference and apply it via a new setFramelessMode(bool) helper.
  • Remove dialog-specific first-show centering logic so placement follows normal Qt/window-manager behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/gui/AudioDeviceChangeDialog.h Removes showEvent override and adds frameless-related members + setFramelessMode(bool) declaration.
src/gui/AudioDeviceChangeDialog.cpp Adds frameless title bar/resizer, applies global frameless setting, and replaces centering showEvent logic with setFramelessMode(bool).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — thanks @rfoust. The implementation is a faithful mirror of the NetworkDiagnosticsDialog frameless pattern:

  • Reads the global FramelessWindow AppSettings value with the same "True" default and string comparison used elsewhere.
  • m_titleBar and m_bodyLayout member shape, plus the geometry-preserve / wasVisible re-show dance in setFramelessMode, matches NetworkDiagnosticsDialog::setFramelessMode (src/gui/NetworkDiagnosticsDialog.cpp:1041).
  • Dropping the show-time centering and relying on Qt placement is consistent with the rest of the dialogs.
  • Title bar widget is parented (new FramelessWindowTitleBar(..., this)), so RAII/ownership is fine.

One non-blocking note: this dialog is constructed on the stack and exec()-ed modally from MainWindow::onAudioDevicesChanged (src/gui/MainWindow.cpp:6094), so a runtime toggle of FramelessWindow while the dialog is open won't propagate — same as other short-lived modal dialogs that aren't plumbed into the MainWindow::setFramelessMode fan-out at src/gui/MainWindow.cpp:11455+. Acceptable for a transient dialog; just flagging in case you wanted live-toggle parity.

No bugs spotted in the diff. Scope matches the PR description.

@ten9876 ten9876 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Pattern matches NetworkDiagnosticsDialog::setFramelessMode line-for-line. The two dialog-patterns.md items not implemented (geometry persistence, MainWindow runtime-toggle wiring) are correctly omitted for this dialog's transient application-modal lifecycle.

@ten9876 ten9876 merged commit 57ecbb0 into aethersdr:main May 13, 2026
9 checks passed
ten9876 pushed a commit that referenced this pull request May 13, 2026
Adds a quick-reference block in CLAUDE.md summarizing the FramelessWindow pattern (FramelessWindowTitleBar + FramelessResizer + setFramelessMode template + AppSettings init) and explicitly forbidding manual first-show (0,0) moves or constructor-time geometry restores. Follow-up to #2618 which removed that exact anti-pattern from AudioDeviceChangeDialog.

Co-Authored-By: rfoust <rfoust@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

3 participants