fix: Terminal theme color not updating with application theme changes - #542
Merged
Conversation
log: TermWidget::onThemeTypeChanged responds to the DTK DGuiApplicationHelper::themeTypeChanged signal. However, it only checks whether extendColorScheme is empty. Since two out of the three terminal theme states have an empty extendColorScheme, the theme fails to update correctly in those cases. pms: bug-365877
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates TermWidget theme-change handling so that terminal colors only follow system light/dark changes when the terminal is configured to follow the system theme, avoiding unintended theme switches when a fixed light/dark theme is selected. Sequence diagram for updated theme change handling in TermWidgetsequenceDiagram
participant DGuiApplicationHelper
participant TermWidget
participant Settings
DGuiApplicationHelper->>TermWidget: onThemeTypeChanged(builtInTheme)
TermWidget->>Settings: extendColorScheme()
Settings-->>TermWidget: expandThemeStr
alt [expandThemeStr is not empty]
Note right of TermWidget: Use extended theme (unchanged)
else [expandThemeStr is empty]
TermWidget->>DGuiApplicationHelper: paletteType()
DGuiApplicationHelper-->>TermWidget: paletteType
alt [paletteType is not UnknownType]
Note right of TermWidget: Fixed light/dark theme, ignore signal
TermWidget-->>DGuiApplicationHelper: return
else [paletteType is UnknownType]
Note right of TermWidget: Follow system light/dark
TermWidget->>TermWidget: setColorScheme(theme)
TermWidget->>Settings: setColorScheme(theme)
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The logic branching on
paletteType() != DGuiApplicationHelper::UnknownTypeis a bit opaque; consider extracting this into a named helper (e.g.isFollowSystemThemeEnabled()) or centralizing the state check so the meaning ofUnknownTypeand the three theme modes is clearer and less error-prone if the enum or modes change later.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The logic branching on `paletteType() != DGuiApplicationHelper::UnknownType` is a bit opaque; consider extracting this into a named helper (e.g. `isFollowSystemThemeEnabled()`) or centralizing the state check so the meaning of `UnknownType` and the three theme modes is clearer and less error-prone if the enum or modes change later.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
lzwind
approved these changes
Jun 15, 2026
Contributor
Author
|
/forcemerge |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
log: TermWidget::onThemeTypeChanged responds to the DTK DGuiApplicationHelper::themeTypeChanged signal. However, it only checks whether extendColorScheme is empty. Since two out of the three terminal theme states have an empty extendColorScheme, the theme fails to update correctly in those cases.
pms: bug-365877
Summary by Sourcery
Ensure terminal color scheme updates correctly when following the system theme and remains stable when a fixed theme is selected.
Bug Fixes:
Enhancements:
Chores: