Skip to content

fix(ui): remove transparent separator lines between filter buttons in…#475

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
Resurgamz:release/eagle
May 26, 2026
Merged

fix(ui): remove transparent separator lines between filter buttons in…#475
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
Resurgamz:release/eagle

Conversation

@Resurgamz
Copy link
Copy Markdown

… photo setting area

  • Change scrollLayout spacing from 2px to 0px to eliminate visible gaps between filter preview buttons
  • The 2px spacing combined with WA_TranslucentBackground caused the underlying viewport background to show through, creating transparent separator lines between each filter option

修复(ui): 去掉拍照设置区域滤镜按钮之间的透明分割线

  • 将 scrollLayout 间距从 2px 改为 0px,消除滤镜预览按钮之间的可见间隙
  • 2px 间距与 WA_TranslucentBackground 配合导致下层 viewport 背景透出,在每个滤镜选项之间形成透明分割线

Log: 去掉滤镜选择面板中各滤镜之间的透明分割线,将 QVBoxLayout 间距从 2px 改为 0px
Bug: https://pms.uniontech.com/bug-view-160651.html

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Resurgamz, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

… photo setting area

  - Change scrollLayout spacing from 2px to 0px to eliminate visible gaps between filter preview
  buttons
  - The 2px spacing combined with WA_TranslucentBackground caused the underlying viewport background
  to show through, creating transparent separator lines between each filter option

  修复(ui): 去掉拍照设置区域滤镜按钮之间的透明分割线

  - 将 scrollLayout 间距从 2px 改为 0px,消除滤镜预览按钮之间的可见间隙
  - 2px 间距与 WA_TranslucentBackground 配合导致下层 viewport
  背景透出,在每个滤镜选项之间形成透明分割线

  Log: 去掉滤镜选择面板中各滤镜之间的透明分割线,将 QVBoxLayout 间距从 2px 改为 0px
  Bug: https://pms.uniontech.com/bug-view-160651.html
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

你好!我是CodeGeeX,你的智能编程助手。我已经仔细审查了你提供的 Git Diff 输入。本次代码变更主要涉及 UI 布局的微调,将边距和间距进行了修改。

以下是我对本次代码变更的详细审查意见:

1. 语法逻辑

  • 状态:良好
  • 分析: 修改宏定义 #define MARGIN 5#define MARGIN 6,以及 setSpacing(2) 修改为 setSpacing(0),在语法上完全正确,逻辑清晰。由于 BUTTON_SIZE 是通过宏计算的 (IMAGE_SIZE + MARGIN * 2),修改 MARGIN 会自动生效,逻辑没有问题。

2. 代码质量

  • 改进意见:建议使用 constexpr 替代宏定义
  • 分析: C++(特别是 Qt5/Qt6 通常基于 C++11 或更高版本)中,推荐使用 constexprconst 变量来替代宏定义。宏定义在预处理阶段进行文本替换,缺乏类型检查,且在调试时无法看到宏的实际值。
  • 改进代码:
    // 替换前的代码
    // #define MARGIN 5
    // #define IMAGE_SIZE 40
    // #define BUTTON_SIZE (IMAGE_SIZE + MARGIN * 2)
    
    // 推荐的改进代码
    constexpr int MARGIN = 6;
    constexpr int IMAGE_SIZE = 40;
    constexpr int BUTTON_SIZE = IMAGE_SIZE + MARGIN * 2;

3. 代码性能

  • 状态:无影响
  • 分析: 这两处修改都是编译期常量或简单的属性设置,对运行时性能没有任何负面影响。将 setSpacing(0) 设置为 0 可能会略微减少布局引擎计算间距的开销,但几乎可以忽略不计。

4. 代码安全

  • 潜在风险:间距设为0可能导致UI元素粘连,影响可点击性(交互安全)
  • 分析:
    • takephotosettingareawidget.cpp 中,将 setSpacing(0) 设为 0 意味着垂直布局中的按钮或控件将紧密贴合,没有任何间隙。如果这些控件是可点击的按钮,紧密贴合极易导致用户的误触,降低交互的容错率。
    • 如果这些控件有边框或背景色,间距为0可能会导致视觉上的粘连,不符合常见的 UI 设计规范。
  • 改进建议: 请与 UI/UX 设计师确认间距为 0 是否符合设计预期。如果是为了去除多余空白,建议保留至少 12 的间距作为安全点击区域;如果控件自身已经包含了足够的内边距,则设为 0 是合理的。

5. 其他建议(代码风格)

  • 类名命名规范:takephotosettingareawidget.cpp 中,对应的类名是 takePhotoSettingAreaWidget。在 Qt/C++ 的惯例中,类名通常使用 大驼峰 命名法,即首字母也应大写,如 TakePhotoSettingAreaWidget。虽然这不影响编译,但符合规范可以提高代码的可读性和专业性。

总结

本次代码变更主要是 UI 微调,语法和功能实现上没有问题。核心建议是:将宏定义升级为 constexpr 以提升代码质量;同时确认 setSpacing(0) 是否会导致按钮误触等交互体验下降的问题。

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: max-lvs, Resurgamz

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Resurgamz
Copy link
Copy Markdown
Author

/merge

@deepin-bot deepin-bot Bot merged commit 011f009 into linuxdeepin:release/eagle May 26, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants