Conversation
1. Change the default background opacity for the custom push button from 0.15 to 0.05 when the button is disabled, so the disabled state renders as a lighter, flatter surface 2. Extract the QStyle::State_Enabled check into a named `enabled` const and only apply the 0.15/0.25/0.35 opacities for enabled, sunken and hover states respectively 3. Apply palette colors to QPalette::All color groups (Button and ButtonText) instead of only the Active group, otherwise the Disabled color group was ignored and the wrong color was painted 4. When the button is highlighted (i.e. the license agreement checkbox is unchecked and the button is disabled), use QPalette::Disabled/ WindowText for the text instead of the highlight color; once the checkbox is checked and the button becomes enabled, the text switches to the Active/Highlight color, making the two states clearly distinguishable Log: Adjusted the license dialog button styling so the disabled and enabled states are visually distinguishable Influence: 1. Open the license dialog with the agreement checkbox unchecked and verify the confirm button uses the disabled text color and the lighter 0.05 background 2. Check the agreement checkbox and verify the button text switches to the active highlight color and the background becomes 0.15 opacity 3. Verify hover and pressed states of the enabled button use 0.25 and 0.35 opacity respectively 4. Verify the button renders correctly under light, dark and high- contrast themes 5. Verify disabled buttons remain non-clickable and enabled buttons trigger the expected action 6. Verify the button also renders correctly when the style is applied outside of the dialog context (e.g. other windows using the same button class) fix: 修正许可协议对话框按钮禁用态样式 1. 将自定义按钮的默认背景透明度从 0.15 改为 0.05,使按钮在禁用状态下呈现 更浅、更平的视觉效果 2. 将 QStyle::State_Enabled 判断提取为具名常量 enabled,仅在启用状态下分 别应用 0.15、0.25、0.35 的透明度对应普通、按下和悬停状态 3. 将调色板颜色应用到 QPalette::All 所有颜色组(Button 与 ButtonText), 而不是仅应用到 Active 组,否则 Disabled 颜色组会被忽略,导致绘制颜色不 正确 4. 当按钮处于高亮状态时(即未勾选许可协议、按钮不可用),文字使用 QPalette::Disabled/WindowText 而非高亮色;勾选协议后按钮变为可用,文字才 切换到 Active/Highlight 高亮色,使两种状态清晰可区分 Log: 调整许可协议对话框按钮样式,使禁用态与可用态可明显区分 Influence: 1. 打开许可协议对话框,保持协议复选框未勾选,验证确认按钮使用禁用态文字 色以及更浅的 0.05 背景 2. 勾选协议复选框,验证按钮文字切换为活动高亮色、背景透明度变为 0.15 3. 验证可用按钮的悬停态与按下态分别使用 0.25 与 0.35 的透明度 4. 验证按钮在浅色、深色及高对比度主题下的渲染效果 5. 验证禁用按钮仍不可点击,可用按钮能触发预期操作 6. 验证在对话框之外的场景(例如使用同一按钮类的其他窗口)中按钮渲染同样 正确 PMS: BUG-360973
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the custom license dialog button’s style-option palette and state handling so disabled buttons render with a lighter background and disabled text, while enabled, hovered, and pressed states retain distinct visual feedback across palette groups and themes. State diagram for license button visual statesstateDiagram-v2
[*] --> Disabled
Disabled: background opacity 0.05
Disabled: text Disabled/WindowText
Disabled --> Enabled: agreement checkbox checked
Enabled: background opacity 0.15
Enabled: text Active/Highlight
Enabled --> Hovered: State_MouseOver
Hovered: background opacity 0.25
Hovered --> Enabled: pointer leaves
Enabled --> Pressed: State_Sunken
Pressed: background opacity 0.35
Pressed --> Enabled: button released
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[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. 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. |
enabledconst and only apply the 0.15/0.25/0.35 opacities for enabled, sunken and hover states respectivelyLog: Adjusted the license dialog button styling so the disabled and enabled states are visually distinguishable
Influence:
fix: 修正许可协议对话框按钮禁用态样式
正确
Log: 调整许可协议对话框按钮样式,使禁用态与可用态可明显区分
Influence:
PMS: BUG-360973
Summary by Sourcery
Fix license dialog button rendering to clearly distinguish disabled, enabled, hover, and pressed states across themes.
Bug Fixes:
Enhancements: