Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Sep 30, 2025

  1. Added BoxShadow component with connector styling to AlertToolTip
  2. Implemented connector line that visually connects tooltip to target
    element
  3. Positioned connector above tooltip with proper spacing and margins
  4. Enhanced border opacity from 0.05 to 0.1 for better visibility
  5. Updated connector background color in dark mode to solid dark gray
    (RGB 51,51,51)

Log: Added visual connector line between alert tooltips and their target
elements

Influence:

  1. Test alert tooltip display with connector line visible
  2. Verify connector positioning relative to tooltip and target element
  3. Check connector appearance in both light and dark themes
  4. Validate connector styling including shadow, border, and colors
  5. Test tooltip animations with the new connector element
  6. Ensure connector doesn't interfere with tooltip functionality

feat: 为警告提示工具添加连接线

  1. 在 AlertToolTip 中添加了带有连接器样式的 BoxShadow 组件
  2. 实现了视觉上连接工具提示和目标元素的连接线
  3. 使用适当的间距和边距将连接线定位在工具提示上方
  4. 将边框不透明度从 0.05 增加到 0.1 以提高可见性
  5. 在深色模式下更新连接器背景颜色为纯深灰色 (RGB 51,51,51)

Log: 在警告提示工具与其目标元素之间添加了视觉连接线

Influence:

  1. 测试带有连接线的警告提示工具显示
  2. 验证连接线相对于工具提示和目标元素的定位
  3. 检查连接线在浅色和深色主题下的外观
  4. 验证连接线样式包括阴影、边框和颜色
  5. 测试带有新连接线元素的工具提示动画
  6. 确保连接线不会干扰工具提示功能

PMS: BUG-334879

Summary by Sourcery

Implement a visual connector line for alert tooltips and adjust related styling

New Features:

  • Add BoxShadow connector in AlertToolTip to visually link the tooltip to its target element

Enhancements:

  • Increase control border opacity from 0.05 to 0.1 for better visibility
  • Update connector background color in dark mode to solid RGB(51,51,51)

1. Added BoxShadow component with connector styling to AlertToolTip
2. Implemented connector line that visually connects tooltip to target
element
3. Positioned connector above tooltip with proper spacing and margins
4. Enhanced border opacity from 0.05 to 0.1 for better visibility
5. Updated connector background color in dark mode to solid dark gray
(RGB 51,51,51)

Log: Added visual connector line between alert tooltips and their target
elements

Influence:
1. Test alert tooltip display with connector line visible
2. Verify connector positioning relative to tooltip and target element
3. Check connector appearance in both light and dark themes
4. Validate connector styling including shadow, border, and colors
5. Test tooltip animations with the new connector element
6. Ensure connector doesn't interfere with tooltip functionality

feat: 为警告提示工具添加连接线

1. 在 AlertToolTip 中添加了带有连接器样式的 BoxShadow 组件
2. 实现了视觉上连接工具提示和目标元素的连接线
3. 使用适当的间距和边距将连接线定位在工具提示上方
4. 将边框不透明度从 0.05 增加到 0.1 以提高可见性
5. 在深色模式下更新连接器背景颜色为纯深灰色 (RGB 51,51,51)

Log: 在警告提示工具与其目标元素之间添加了视觉连接线

Influence:
1. 测试带有连接线的警告提示工具显示
2. 验证连接线相对于工具提示和目标元素的定位
3. 检查连接线在浅色和深色主题下的外观
4. 验证连接线样式包括阴影、边框和颜色
5. 测试带有新连接线元素的工具提示动画
6. 确保连接线不会干扰工具提示功能

PMS: BUG-334879
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Sep 30, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#534
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 30, 2025

Reviewer's Guide

This PR extends the AlertToolTip QML component by injecting a styled BoxShadow “connector” element above the tooltip to visually link it to its target, and adjusts palette definitions for improved border visibility and dark-mode styling.

Entity relationship diagram for updated FlowStyle palette properties

erDiagram
    PALETTE {
        normal real
        normalDark real
    }
    ALERT_TOOLTIP {
        connectorBackground PALETTE
        connecterdropShadow PALETTE
    }
    FLOW_STYLE {
        border PALETTE
        alertToolTip ALERT_TOOLTIP
    }
    FLOW_STYLE ||--|{ ALERT_TOOLTIP : contains
    ALERT_TOOLTIP ||--|{ PALETTE : uses
Loading

Class diagram for updated AlertToolTip and BoxShadow connector

classDiagram
    class AlertToolTip {
        +BoxShadow line
        // Tooltip logic and animations
    }
    class BoxShadow {
        +dropShadowColor: D.Palette
        +backgroundColor: D.Palette
        +borderColor: D.Palette
        +y: number
        +width: number
        +height: number
        +shadowBlur: number
        +shadowOffsetY: number
        +shadowColor: color
        +cornerRadius: number
    }
    class Rectangle {
        +color: color
        +border.color: color
        +border.width: number
    }
    AlertToolTip "1" -- "1" BoxShadow : contains
    BoxShadow "1" -- "1" Rectangle : contains
Loading

File-Level Changes

Change Details Files
Introduce BoxShadow connector element in AlertToolTip
  • Add BoxShadow with dropShadowColor, backgroundColor, borderColor properties
  • Compute y-position above tooltip using topMargin and topPadding
  • Embed Rectangle child for background color and border rendering
qt6/src/qml/AlertToolTip.qml
Increase control border opacity for better visibility
  • Change border.normal opacity from 0.05 to 0.1
  • Change border.normalDark opacity from 0.05 to 0.1
qt6/src/qml/FlowStyle.qml
Update connector background color in dark mode
  • Set connecterBackground.normalDark to solid RGB(51,51,51)
  • Ensure connector background remains white in light mode
qt6/src/qml/FlowStyle.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

代码审查报告:AlertToolTip.qml 和 FlowStyle.qml

AlertToolTip.qml 分析

语法逻辑

  1. 新增的 BoxShadow 组件定义合理,但存在一些潜在问题:
    • y 属性的计算方式可能不够直观:y: - height * (0.75) - control.topMargin - control.topPadding
    • 使用了 D.ColorSelector 但没有看到其定义,可能存在依赖风险

代码质量

  1. 命名规范:

    • 变量名 line 不够描述性,建议改为 connectorconnectorShadow 更合适
    • 属性名 dropShadowColorbackgroundColorborderColor 命名清晰
  2. 结构组织:

    • 新增的 BoxShadow 组件及其子元素结构合理,但缺少注释说明其用途

代码性能

  1. 阴影效果(shadowBlur: 4, shadowOffsetY: 2)可能会影响渲染性能,特别是在低端设备上
  2. 建议考虑在某些场景下可以动态调整阴影参数以平衡视觉效果和性能

代码安全

  1. 依赖于 DS.StyleD.Palette 等外部样式对象,需要确保这些对象已正确初始化
  2. 使用了 D.ColorSelector 但未定义,可能导致运行时错误

改进建议

  1. 为 BoxShadow 组件添加注释说明其用途
  2. 改进变量命名,使其更具描述性
  3. 考虑添加条件渲染,在性能敏感的场景下可以禁用阴影效果
  4. 确保 D.ColorSelector 的定义存在或使用替代方案
  5. 考虑将阴影参数提取为可配置项,方便后续调整

FlowStyle.qml 分析

语法逻辑

  1. 边框颜色值从 0.05 调整到 0.1 是合理的,增加了可见度
  2. 连接器背景色的调整从 rgba(0, 0, 0, 0.1) 改为 rgba(51/255.0, 51/255.0, 51/255.0, 1)
    • 使用了精确的 RGB 值(51/255.0 ≈ 0.2)
    • 透明度从 0.1 改为 1.0,这是一个显著变化,需要确认是否符合设计需求

代码质量

  1. 颜色值定义方式不一致:

    • 有些使用 Qt.rgba(),有些使用直接数值
    • 建议统一使用 Qt.rgba() 或十六进制表示法
  2. 注释不足:

    • 缺少对样式属性用途的说明
    • 缺少对颜色值选择原因的说明

代码性能

  1. 样式定义使用了 QtObject,性能影响不大
  2. 颜色计算在运行时进行,可以考虑预计算常用颜色值

代码安全

  1. 所有颜色值都在有效范围内,没有安全隐患
  2. 依赖的 D.Palette 对象需要确保已正确初始化

改进建议

  1. 统一颜色值的表示方式,建议使用 Qt.rgba() 或十六进制
  2. 为样式属性添加注释说明其用途和设计考虑
  3. 对于连接器背景色的透明度从 0.1 变为 1.0 的重大变化,建议添加注释说明原因
  4. 考虑将常用的颜色值提取为命名常量,提高代码可维护性

总体而言,这两处修改主要是视觉样式的调整,语法上没有明显问题。但建议增加适当的注释,并统一代码风格,以提高代码的可维护性和可读性。

Copy link

@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.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

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

@18202781743 18202781743 merged commit e59a1e3 into linuxdeepin:master Oct 9, 2025
20 of 21 checks passed
18202781743 pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 9, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#534
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