Add frameless support to audio device dialog#2618
Conversation
There was a problem hiding this comment.
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
FramelessWindowTitleBarto the dialog and wire upFramelessResizerfor edge resizing in frameless mode. - Read the global
AppSettings("FramelessWindow")preference and apply it via a newsetFramelessMode(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.
There was a problem hiding this comment.
Looks good — thanks @rfoust. The implementation is a faithful mirror of the NetworkDiagnosticsDialog frameless pattern:
- Reads the global
FramelessWindowAppSettings value with the same"True"default and string comparison used elsewhere. m_titleBarandm_bodyLayoutmember shape, plus the geometry-preserve /wasVisiblere-show dance insetFramelessMode, matchesNetworkDiagnosticsDialog::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
left a comment
There was a problem hiding this comment.
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.
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>
Summary
Testing