fix(personalization): fix treeland theme switching logic#3294
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRemoves direct updates of the model’s current appearance based on Treeland’s actual light/dark theme, and instead relies on dde-appearance’s GlobalTheme as the single source of truth for control center theme state to keep the 'Auto' option stable. 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 found 1 issue, and left some high level feedback:
- If
m_model->setCurrentAppearance(...)is no longer used as a result of this change, consider removing the now-unused method and related state to avoid confusion and dead code. - Given that the model no longer reacts to
themeTypehere, double-check whether any UI elements still depend on this signal-to-model linkage and, if not, clean up any remaining references tocurrentAppearancein the model to keep responsibilities clear.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If `m_model->setCurrentAppearance(...)` is no longer used as a result of this change, consider removing the now-unused method and related state to avoid confusion and dead code.
- Given that the model no longer reacts to `themeType` here, double-check whether any UI elements still depend on this signal-to-model linkage and, if not, clean up any remaining references to `currentAppearance` in the model to keep responsibilities clear.
## Individual Comments
### Comment 1
<location path="src/plugin-personalization/operation/treelandworker.cpp" line_range="632-634" />
<code_context>
- m_model->setCurrentAppearance("");
- break;
- }
+ // 设置给Treeland的深浅色属性是系统实际生效的深浅色,当控制中心设置为自动时,此时系统的深浅色会动态的变更
+ // 如果直接把treeland的属性设置到model中,会导致控制中心选项中的自动显示为深色或者浅色,这不符合预期。
+ // 现在使用 dde-appearance 保存的GlobalTheme属性来作为控制中心深浅色的数据来源,该数据在自动时数据保持不变
}
</code_context>
<issue_to_address>
**issue:** Comment describes behavior that is not reflected in this function’s implementation.
This comment describes behavior (using dde-appearance’s GlobalTheme as the source of truth in auto mode) that this function no longer implements—it only emits a signal. If that logic now lives elsewhere, this comment should be updated or removed so it reflects what this function actually does, and the higher-level behavior documented where it is implemented instead.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
robertkill
previously approved these changes
Jun 12, 2026
48e6f49 to
b40ca36
Compare
当控制中心设置为自动时,系统深浅色会动态变更。之前直接把treeland的实际深浅色 属性设置到model中,会导致控制中心选项中的"自动"显示为"深色"或"浅色", 这不符合预期。 现在改用 dde-appearance 保存的 GlobalTheme 属性作为控制中心深浅色的数据来源, 该数据在自动模式下保持不变,正确显示为"自动"。 pms: BUG-346357
robertkill
approved these changes
Jun 16, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, robertkill 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 |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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.
当控制中心设置为自动时,系统深浅色会动态变更。之前直接把treeland的实际深浅色
属性设置到model中,会导致控制中心选项中的"自动"显示为"深色"或"浅色",
这不符合预期。
现在改用 dde-appearance 保存的 GlobalTheme 属性作为控制中心深浅色的数据来源, 该数据在自动模式下保持不变,正确显示为"自动"。
pms: BUG-346357
Summary by Sourcery
Bug Fixes: