Skip to content

Adopt the current palette when a dialog is shown on iOS - #3999

Open
ann0see wants to merge 1 commit into
mainfrom
ios/fix-dark-mode-palette
Open

ann0see wants to merge 1 commit into
mainfrom
ios/fix-dark-mode-palette

Conversation

@ann0see

@ann0see ann0see commented Nov 15, 2026

Copy link
Copy Markdown
Member

Short description of changes

Adopt the current application palette when a dialog is shown, so that dialogs opened after the system appearance is known are not painted with black text on the dark background.

The dialogs are created in the CClientDlg constructor, i.e. before iOS has applied the appearance of the system, so they resolve the light palette even when the system uses the dark one. Qt's iOS platform plugin reports a change of the colour scheme to the application only (QApplicationPrivate::handleThemeChanged() updates the palette but does not notify the widgets), so the stale palette is never replaced. The result was a server list with the server names in black on the dark background until something unrelated repainted the dialog.

Clearing the palette in CBaseDlg::event() when the dialog is shown makes it inherit the current application palette before the first paint. The change is guarded with Q_OS_IOS, so the other platforms are untouched.

CHANGELOG: iOS: Fixed dialog contents being unreadable in dark mode

Context: Fixes an issue?

Fixes #3994 (dark mode item).

Measured on the iPad Pro 11-inch simulator with Qt 6.11.1:

Case before after
fresh start in dark mode, open Connection Setup server names black on black until a tap readable immediately
fresh start in light mode, open Connection Setup readable unchanged
crash reports none none

Does this change need documentation? What needs to be documented and how?

No.

Status of this Pull Request

Working implementation.

What is missing until this pull request can be merged?

  • A related, separate problem is not fixed here: after the full screen chat window is hidden, the main window is painted with black text until it is tapped or the app is backgrounded and resumed. That happens on main with or without this change, and none of the palette or repaint attempts from inside Jamulus changed it, so it looks like the palette itself reverts to light while the window keeps its dark background. It needs its own investigation, probably with a Qt bug report.
  • Only tested in the simulator, not on a physical device, and not with an appearance change while the app is running.
  • Only the connection setup dialog was exercised; the other dialogs are covered by the same base class.

🤖 Used AI: DeepSeek V4.1 Flash, OpenCode

@ann0see ann0see added the AI AI generated or potentially AI generated label Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

CBaseDlg now handles dialog events. On iOS, it resets the dialog palette when it receives a Show event. It then returns the result from QDialog’s event handler.

Changes: iOS Dialog Palette

Layer / File(s) Summary
Handle dialog show events
src/util.h
CBaseDlg delegates events to QDialog. On iOS Show events, it resets the palette to the default palette.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: bug

Suggested reviewers: pljones, softins

Merge Risk: Minimal · up to f0d8a

On iOS, dialogs adopt the current application palette when shown, which fixes black text on a dark background. Other platforms are unaffected. The risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: dialogs on iOS adopt the current application palette when shown. The raw summary confirms CBaseDlg::event() resets the dialog palette on QEvent::Show under iOS, so the…
Description check Passed The description follows the template. It gives a short description of changes, a CHANGELOG entry in past tense, a context section that links issue #3994, a documentation answer, the status of the pull…
Linked Issues check Passed Directly linked issue #3994 has many items. The PR objectives scope this PR to the dark-mode dialog item: dialog text black on a dark background until repainted. The reviewed head implements that item…
Out of Scope Changes check Passed The supplied change summary lists one changed file, src/util.h, with +19/-0 lines and no changes to declared public entities. The head content of src/util.h shows the added CBaseDlg::event() override.…
Full details: Title check

Explanation

The title names the main change: dialogs on iOS adopt the current application palette when shown. The raw summary confirms CBaseDlg::event() resets the dialog palette on QEvent::Show under iOS, so the title matches the changeset. It is specific and concise.

Full details: Description check

Explanation

The description follows the template. It gives a short description of changes, a CHANGELOG entry in past tense, a context section that links issue #3994, a documentation answer, the status of the pull request, and open items. It also gives test results and states the known limits of testing. The template checklist is not ticked, which is a non-critical gap. The template's optional AUTOBUILD note is not present, but it applies only to platform-specific code, and this change is iOS-specific, so the author may need to add it.

Full details: Linked Issues check

Explanation

Directly linked issue #3994 has many items. The PR objectives scope this PR to the dark-mode dialog item: dialog text black on a dark background until repainted. The reviewed head implements that item. src/util.h at head adds a CBaseDlg::event() override. Under Q_OS_IOS, on QEvent::Show, it calls setPalette( QPalette() ). A default QPalette carries no resolved colours, so the dialog takes the current application palette before its first paint. This addresses the stale palette described in #3994 for CBaseDlg-derived dialogs, including the Connection Setup dialog. The other #3994 items (chat window at startup, Settings loss, keyboard layout, message box titles, and the dark-mode chat-hide item) are not objectives of this PR, per the PR objectives. The PR description states the chat-hide black-text problem is not fixed here. No automated test was added. The requirement is a UI rendering fix on iOS, and the issue does not request a test. Verification in the PR is manual, in the simulator only. The full PR diff could not be read (changed blobs unavailable). The conclusion rests on the head content of src/util.h and the supplied change summary (+19/-0 in src/util.h).

Full details: Out of Scope Changes check

Explanation

The supplied change summary lists one changed file, src/util.h, with +19/-0 lines and no changes to declared public entities. The head content of src/util.h shows the added CBaseDlg::event() override. Its only functional change is the Q_OS_IOS-guarded palette reset on QEvent::Show. The code delegates to QDialog::event() and returns its result, so other platforms and other event types keep their behaviour. The change directly implements the #3994 dark-mode dialog objective, so it is not unrelated. The full diff could not be read, so changes outside src/util.h are not independently verified. The supplied summary does not report any.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: af93f168-6016-422c-94f0-25a54d73bc45
Commits

Reviewing files that changed from the base of the PR and between 3d52f7a and f0d8a90.

Files selected for processing: 1

  • src/util.h

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@ann0see ann0see self-assigned this Nov 15, 2026
@ann0see
ann0see marked this pull request as draft November 15, 2026 18:31
@ann0see ann0see mentioned this pull request Nov 15, 2026
6 of 16 tasks
The dialogs are created in the CClientDlg constructor, before iOS has applied the
appearance of the system, so they resolve the light palette even when the system
uses the dark one. The iOS platform plugin reports a change of the colour scheme
to the application only, not to the windows, so the stale palette is never
replaced and the dialogs are painted with black text on the dark background until
something unrelated repaints them.

Clear the palette when a dialog is shown, so that it inherits the current
application palette before it is painted for the first time.
@ann0see
ann0see force-pushed the ios/fix-dark-mode-palette branch from 3d52f7a to f0d8a90 Compare November 15, 2026 19:27
@ann0see ann0see added bug Something isn't working Mobile UI Issues with the UI on mobile platforms iOS iOS runtime issue labels Nov 15, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Nov 15, 2026
@ann0see
ann0see marked this pull request as ready for review November 15, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI generated or potentially AI generated bug Something isn't working iOS iOS runtime issue Mobile UI Issues with the UI on mobile platforms

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

AI bug findings for iOS

1 participant