Skip to content

Conversation

@BLumia
Copy link
Member

@BLumia BLumia commented Dec 29, 2025

移除托盘网络插件 tooltip 左右两侧的 10px 空白

同时删除未参与构建且无法顺利构建的 dock 插件示例

Summary by Sourcery

Remove extra horizontal padding from the dock network plugin tooltip and clean up unused dock example plugin sources.

Bug Fixes:

  • Eliminate unintended left and right margins in the dock network plugin tooltip to align its content with design expectations.

Chores:

  • Remove the unused and non-buildable dock example plugin from the source tree and build configuration.

移除托盘网络插件 tooltip 左右两侧的 10px 空白

PMS: BUG-326409
Log:
@BLumia BLumia requested review from caixr23 and yixinshark December 29, 2025 05:31
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 29, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes the extra horizontal padding from the dock network plugin tooltip label and cleans up an unused, non-buildable dock example plugin by dropping its CMake integration and source files.

Flow diagram for updated CMake plugin subdirectories

flowchart TD
  RootCMake[CMake_root]
  DockNetwork[dock_network_plugin]
  DSSNetwork[dss_network_plugin]
  NetworkService[network_service_plugin]

  RootCMake --> DockNetwork
  RootCMake --> DSSNetwork
  RootCMake --> NetworkService
Loading

File-Level Changes

Change Details Files
Adjust tooltip label layout to remove unwanted horizontal padding in the dock network plugin.
  • Update tooltip label contents margins to eliminate left and right padding while keeping vertical margins unchanged
  • Retain existing font change handling, hover-tip setup, and label configuration
net-view/window/netstatus.cpp
Remove obsolete dock example plugin from the build and source tree.
  • Delete the dock-example subdirectory from the build configuration so it is no longer added as a subproject
  • Remove all remaining dock-example source files and its local CMakeLists to avoid build failures and dead code
CMakeLists.txt
dock-example/CMakeLists.txt
dock-example/docktestwidget.cpp
dock-example/docktestwidget.h
dock-example/main.cpp

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

deepin pr auto review

我来帮你分析这段代码变更。这是一个删除了dock-example目录并修改了netstatus.cpp的git diff。让我从几个方面来分析:

  1. 语法逻辑:
  • 代码删除操作是合理的,删除了整个dock-example目录,包括CMakeLists.txt、docktestwidget.h/cpp和main.cpp
  • 在主CMakeLists.txt中注释掉了dock-example的add_subdirectory,保持一致性
  • netstatus.cpp中只修改了一行代码,将m_tipsLabel的边距从(10,0,10,0)改为(0,0,0,0)
  1. 代码质量:
  • 删除dock-example是一个好的做法,因为从代码结构看,这应该是一个测试示例目录,不应该包含在最终产品中
  • 修改tips标签边距的改动很小且明确,但缺少注释说明为什么要这样修改
  1. 代码性能:
  • 删除未使用的测试代码可以提高编译效率
  • 移除边距设置不会对性能产生显著影响
  1. 代码安全:
  • 删除测试代码减少了潜在的安全风险点
  • 修改UI边距不会引入安全问题

改进建议:

  1. 对于netstatus.cpp的修改:
// 建议添加注释说明修改原因
m_tipsLabel->setContentsMargins(0, 0, 0, 0); // 移除边距以优化显示效果
  1. 对于CMakeLists.txt的修改:
# 建议添加注释说明移除原因
# dock-example is a test directory and not needed in production
# add_subdirectory("dock-example")
  1. 建议在删除dock-example之前:
  • 确保其中的测试用例已经迁移到专门的测试目录
  • 保留可能有用的测试代码作为参考
  • 检查是否有其他代码依赖这个目录
  1. 对于UI修改:
  • 建议验证修改后的视觉效果是否符合设计要求
  • 考虑是否需要在其他相关组件中也做相应调整
  1. 版本控制:
  • 建议在commit message中详细说明删除dock-example的原因
  • 记录UI边距修改的具体原因和预期效果

这些修改整体上是合理的,主要是清理了不需要的测试代码,并做了一个小的UI调整。建议在后续开发中保持代码库的整洁,避免将测试代码混入生产代码中。

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 - I've left some high level feedback:

  • Since the tooltip is reverting to zero content margins, consider whether you can just remove the setContentsMargins call entirely (letting the default style decide padding) or confirm that padding isn’t better handled at the layout/container level instead of the label itself, to avoid overly tight text against the tooltip border.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the tooltip is reverting to zero content margins, consider whether you can just remove the `setContentsMargins` call entirely (letting the default style decide padding) or confirm that padding isn’t better handled at the layout/container level instead of the label itself, to avoid overly tight text against the tooltip border.

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@BLumia BLumia merged commit a4dcba2 into linuxdeepin:master Dec 29, 2025
16 of 18 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