feat: 完善普通文字按钮投影、内阴影与深色模式配色 - #671
Open
iCancely wants to merge 3 commits into
Open
Conversation
- BoxPanel: 新增 enableDropShadow/enableInnerShadow/enableGradient 开关, 默认关闭以保持其他控件外观不变。硬投影(blur=0)使用两个圆角矩形 在 z=BelowOrder 层绘制,由按钮自身背景和边框自然遮挡重叠部分, 仅在按钮外部显示带圆角的投影条带 - FlowStyle: 修正 dropShadow/dropShadow2 调色板,normal/hover 远投影 rgba(0,0,0,0.05) 近投影 rgba(0,0,0,0.1),pressed 远投影 rgba(0,0,0,0.1),pressed 文字颜色与 normal 一致 - ButtonPanel: 配置三种状态的硬投影偏移量,normal/hover 为 offsetY=2+offsetY2=1,pressed 为 offsetY=1 - Button: 仅普通文字按钮启用投影、内阴影和渐变
- BoxPanel: 投影矩形改为与 backgroundRect 同尺寸同圆角,不再 扩展 borderWidth;加 antialiasing: false 使投影边缘为硬边 - FlowStyle: dropShadow2 近投影 normal/hover 从 0.1 调整为 0.05; 新增 normalDark 调色板:深色模式渐变背景 rgba(60,60,60,1)→ rgba(45,45,45,1)、外描边 rgba(0,0,0,0.05)、顶部内阴影 rgba(0,0,0,0.5)、底部内阴影 rgba(255,255,255,0.07)、 dropShadow/dropShadow2 设为 transparent(深色无外投影)
- BoxInsetShadow: blur=0 硬投影时使用对称 border 并加 1px padding, 避免非对称 border 占满中心区域导致 BorderImage 无法拉伸 - BoxPanel: 新增 overlayColor 叠加层;内阴影改为 blur=0/spread=0 硬边; 新增 __hasVisibleHardDropShadow 判断,深色模式无外投影时描边完全内绘 - InsideBoxBorder/OutsideBoxBorder: 新增 borderInside 属性,无外投影时 描边完全内绘避免按钮外侧残留细线 - FlowStyle: 深色模式渐变背景与内/外描边透明度调整,新增 hoveredDark 与 overlayColor 调色板,flatBackground 深色模式配色更新 - dquickimageprovider: 支持 blur=0 硬投影图像生成,内阴影偏移时补充 不透明 padding 填充位移产生的间隙 - 新增 ut_render_dark_hover 渲染测试
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: iCancely 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 |
Reviewer's Guide该 PR 通过 BoxPanel 的可选效果开关、ButtonPanel 的状态参数和 FlowStyle 的多状态深色配色,恢复普通文字按钮的硬投影、内阴影与渐变;同时扩展 QImage 阴影生成器支持 blur=0,并调整描边边界处理以避免深色模式下的边缘伪影,最后加入深色 hover 渲染测试。 Sequence diagram for normal and dark-mode button renderingsequenceDiagram
participant Button
participant ButtonPanel
participant FlowStyle
participant BoxPanel
participant DQuickShadowProvider
participant Borders
Button->>ButtonPanel: enableDropShadow / enableInnerShadow / enableGradient
ButtonPanel->>FlowStyle: selectValue for button state
FlowStyle-->>ButtonPanel: background, shadow, border and overlay colors
ButtonPanel->>BoxPanel: configure boxShadowBlur=0 and offsets
BoxPanel->>DQuickShadowProvider: requestImage for hard shadow
DQuickShadowProvider-->>BoxPanel: padded hard-shadow image
BoxPanel->>Borders: set borderInside when no visible outer shadow
BoxPanel-->>Button: render background, shadows, gradient and borders
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
self-requested a review
August 26, 2026 02:23
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.
概述
完善普通文字按钮的投影、内阴影、渐变效果与深色模式配色,并将相关渲染基础设施(硬投影图像生成)一并补齐。
改动内容
恢复普通文字按钮的硬投影、内阴影和渐变效果
BoxPanel: 新增enableDropShadow/enableInnerShadow/enableGradient开关,默认关闭。硬投影(blur=0)使用两个圆角矩形在BelowOrder层绘制,由按钮自身背景和边框自然遮挡重叠部分,仅在外部显示带圆角的投影条带FlowStyle: 修正dropShadow/dropShadow2调色板,normal/hover 远投影rgba(0,0,0,0.05)近投影rgba(0,0,0,0.1),pressed 文字颜色与 normal 一致ButtonPanel: 配置三种状态的硬投影偏移量,normal/hover 为offsetY=2 + offsetY2=1,pressed 为offsetY=1Button: 仅普通文字按钮启用投影、内阴影和渐变调整按钮投影硬度与深色模式 normal 调色板
BoxPanel: 投影矩形改为与backgroundRect同尺寸同圆角,加antialiasing: false使投影边缘为硬边FlowStyle:dropShadow2近投影 normal/hover 从 0.1 调整为 0.05;新增normalDark调色板:深色模式渐变背景、外描边、内阴影、投影配色完善深色模式配色与硬投影渲染
BoxInsetShadow: blur=0 硬投影时使用对称 border 并加 1px padding,避免非对称 border 占满中心区域导致 BorderImage 无法拉伸BoxPanel: 新增overlayColor叠加层;内阴影改为 blur=0/spread=0 硬边;新增__hasVisibleHardDropShadow判断,深色模式无外投影时描边完全内绘InsideBoxBorder/OutsideBoxBorder: 新增borderInside属性,无外投影时描边完全内绘避免按钮外侧残留细线FlowStyle: 深色模式渐变背景与内/外描边透明度调整,新增hoveredDark与overlayColor调色板,flatBackground深色模式配色更新dquickimageprovider: 支持 blur=0 硬投影图像生成,内阴影偏移时补充不透明 padding 填充位移产生的间隙ut_render_dark_hover渲染测试测试
新增
ut_render_dark_hover渲染测试,覆盖深色模式 hover 状态按钮渲染。Summary by Sourcery
Restore polished shadow and gradient effects for normal text buttons while improving dark-mode styling and hard-shadow rendering.
New Features:
Bug Fixes:
Enhancements:
Tests: