fix(dde-license-dialog): correct disabled-state button color in disclaimer dialog (bug 360973) - #446
Conversation
…aimer dialog Bug 360973: 控制中心开启开发者模式免责声明框"确定"按钮活动色状态有误 Root cause: Content::updateAcceptBtnPalette() set QPalette::Disabled ButtonText to the highlight (active) color, so the confirm button appeared active even before the user checked the agreement checkbox. The QSS also lacked a :disabled pseudo-state, so the disabled background was identical to the normal background. Fix: - Disabled ButtonText now uses the standard DTK disabled text color (QPalette::Disabled, QPalette::WindowText) instead of highlight. - Added QPushButton:disabled rule to the accept-button QSS with a lighter background so the disabled state is visually distinct. - Kept the Normal ButtonText as highlight color (active state after checking the agreement) so the enabled/disabled contrast is clear.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xujin177 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 |
|
Hi @xujin177. Thanks for your PR. 😃 |
|
Hi @xujin177. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the accept/confirm button’s palette and styles so its disabled state uses DTK’s standard disabled text color and a distinct disabled background, while keeping the normal/active state highlight color for clarity between enabled and disabled states. Flow diagram for updated accept button palette handlingflowchart TD
A["Content::updateAcceptBtnPalette"] --> B["Set cancelBtnStyle on m_cancelBtn"]
A --> C["Set acceptBtnStyle on m_acceptBtn"]
C --> D["Get DPalette pa from m_acceptBtn"]
D --> E["Set QPalette::Normal ButtonText to pa.highlight().color()"]
E --> F["Set QPalette::Disabled ButtonText to pa.color(QPalette::Disabled, QPalette::WindowText)"]
F --> G["Apply palette pa to m_acceptBtn"]
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:
- Consider factoring the duplicated QPushButton base style (background/border/radius/hover/pressed) into a shared helper or constant so that future visual changes don’t need to be updated in multiple QStrings.
- To avoid potential theme inconsistencies, you may want to drive the disabled background RGBA color through the palette/theme utilities rather than hard-coding
rgba(0, 0, 0, 0.05).
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider factoring the duplicated QPushButton base style (background/border/radius/hover/pressed) into a shared helper or constant so that future visual changes don’t need to be updated in multiple QStrings.
- To avoid potential theme inconsistencies, you may want to drive the disabled background RGBA color through the palette/theme utilities rather than hard-coding `rgba(0, 0, 0, 0.05)`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Bug 360973
控制中心开启开发者模式免责声明框"确定"按钮活动色状态有误
Root Cause
Content::updateAcceptBtnPalette()indde-license-dialog/src/content.cppsetQPalette::DisabledButtonText to the highlight (active) color, so the confirm button appeared active even before the user checked the agreement checkbox. The QSS also lacked a:disabledpseudo-state, so the disabled background was identical to the normal background.Fix
QPalette::Disabled, QPalette::WindowText) instead of highlight.QPushButton:disabledrule to the accept-button QSS with a lighter background so the disabled state is visually distinct.Testing
g++ -std=c++17 -fsyntax-only.QPalette::Disabled, QPalette::WindowTextwhich adapts to the DTK theme.Related: DDE-65 / bug 360973
Summary by Sourcery
Correct the visual disabled state of the disclaimer dialog’s confirm button to avoid it appearing active before agreement.
Bug Fixes: