fix: adjust scrollbar visibility based on system theme policy#301
Merged
mhduiy merged 1 commit intolinuxdeepin:masterfrom Jan 30, 2026
Merged
fix: adjust scrollbar visibility based on system theme policy#301mhduiy merged 1 commit intolinuxdeepin:masterfrom
mhduiy merged 1 commit intolinuxdeepin:masterfrom
Conversation
b387b71 to
729f99b
Compare
18202781743
reviewed
Jan 30, 2026
Changed the scrollbar visibility initialization logic in ChameleonStyle to respect system theme's scrollbar policy. Previously, scrollbars were always set to visible by default, then hidden via animation. Now, when the system theme specifies Qt::ScrollBarAsNeeded policy, scrollbars start as invisible; otherwise, they remain visible by default. This ensures proper scrollbar behavior alignment with user's system preferences. fix: 根据系统主题策略调整滚动条可见性 修改了ChameleonStyle中滚动条可见性的初始化逻辑,以遵循系统主题的滚动条 策略。之前滚动条始终默认设置为可见,然后通过动画隐藏。现在,当系统主题指 定Qt::ScrollBarAsNeeded策略时,滚动条初始为不可见;其他情况下保持默认可 见。这确保了滚动条行为与用户系统偏好设置的一致性。 PMS: BUG-339051
18202781743
approved these changes
Jan 30, 2026
Contributor
deepin pr auto review这段代码主要涉及 Qt 框架下滚动条的动画控制逻辑,通过 1. 语法逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
总结与改进建议总体来说,这次修改是一次高质量的代码重构,主要是修正了变量命名的语义问题,使得代码逻辑更容易理解。 改进建议表:
示例优化代码(针对代码质量建议): // ChameleonStyle.h (建议添加)
class ChameleonStyle : public ... {
// ...
private:
static const char* const kPropScrollbarHideAni;
// ...
};
// ChameleonStyle.cpp (建议添加)
const char* const ChameleonStyle::kPropScrollbarHideAni = "_d_dtk_scrollbar_hide_ani";
// 在函数中使用
bool ChameleonStyle::hideScrollBarByAnimation(const QStyleOptionSlider *scrollBar, ...) {
// ...
// 使用常量替代字符串字面量
sbar->setProperty(kPropScrollbarHideAni, true);
// ...
} |
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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.
Changed the scrollbar visibility initialization logic in ChameleonStyle to respect system theme's scrollbar policy. Previously, scrollbars were always set to visible by default, then hidden via animation. Now, when the system theme specifies Qt::ScrollBarAsNeeded policy, scrollbars start as invisible; otherwise, they remain visible by default. This ensures proper scrollbar behavior alignment with user's system preferences.
fix: 根据系统主题策略调整滚动条可见性
修改了ChameleonStyle中滚动条可见性的初始化逻辑,以遵循系统主题的滚动条
策略。之前滚动条始终默认设置为可见,然后通过动画隐藏。现在,当系统主题指
定Qt::ScrollBarAsNeeded策略时,滚动条初始为不可见;其他情况下保持默认可
见。这确保了滚动条行为与用户系统偏好设置的一致性。
PMS: BUG-339051