Skip to content

style: adjust bluetooth adapter item layout margins#359

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-311109
Aug 28, 2025
Merged

style: adjust bluetooth adapter item layout margins#359
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-311109

Conversation

@wjyrich

@wjyrich wjyrich commented Aug 28, 2025

Copy link
Copy Markdown
Contributor
  1. Set contents margins to 0 for myDeviceLayout to remove extra spacing
  2. Reduced spacing between myDeviceWidget and otherDeviceListView from 5 to 4 pixels
  3. These changes improve visual consistency and reduce unnecessary whitespace
  4. Maintains proper spacing while optimizing the UI layout

style: 调整蓝牙适配器项布局边距

  1. 将 myDeviceLayout 的内容边距设置为 0 以移除额外间距
  2. 将 myDeviceWidget 和 otherDeviceListView 之间的间距从 5 像素减少到 4 像素
  3. 这些更改提高了视觉一致性并减少了不必要的空白
  4. 在优化 UI 布局的同时保持适当的间距

Pms: BUG-311109

Summary by Sourcery

Clean up Bluetooth adapter item layout by resetting content margins and reducing inter-widget spacing for a more consistent UI

Enhancements:

  • Set myDeviceLayout contents margins to zero to eliminate extra whitespace
  • Reduce spacing between myDeviceWidget and otherDeviceListView from 5 to 4 pixels for improved visual consistency

@sourcery-ai

sourcery-ai Bot commented Aug 28, 2025

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR refines the Bluetooth adapter item UI by removing extra inner margins on the device layout and slightly reducing the spacing between device sections to enhance visual consistency and minimize unnecessary whitespace.

Class diagram for updated BluetoothAdapterItem UI layout

classDiagram
  class BluetoothAdapterItem {
    +void initUi()
    - QVBoxLayout *myDeviceLayout
    - QWidget *m_myDeviceWidget
    - QLabel *m_myDeviceLabel
    - QListView *m_myDeviceListView
    - QListView *m_otherDeviceListView
    - QVBoxLayout *mainLayout
    ...
  }
  BluetoothAdapterItem : initUi() modifies myDeviceLayout margins to 0
  BluetoothAdapterItem : mainLayout spacing between widgets changed from 5 to 4
Loading

File-Level Changes

Change Details Files
Remove extra layout margins in myDeviceLayout
  • Set myDeviceLayout contents margins to (0,0,0,0)
plugins/dde-dock/bluetooth/componments/bluetoothadapteritem.cpp
Reduce spacing between myDeviceWidget and otherDeviceListView
  • Change mainLayout spacing from 5px to 4px
plugins/dde-dock/bluetooth/componments/bluetoothadapteritem.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

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
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich, yixinshark

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

1. Set contents margins to 0 for myDeviceLayout to remove extra spacing
2. Reduced spacing between myDeviceWidget and otherDeviceListView from 5
to 4 pixels
3. These changes improve visual consistency and reduce unnecessary
whitespace
4. Maintains proper spacing while optimizing the UI layout

style: 调整蓝牙适配器项布局边距

1. 将 myDeviceLayout 的内容边距设置为 0 以移除额外间距
2. 将 myDeviceWidget 和 otherDeviceListView 之间的间距从 5 像素减少到 4
像素
3. 这些更改提高了视觉一致性并减少了不必要的空白
4. 在优化 UI 布局的同时保持适当的间距

Pms: BUG-311109
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来审查这段代码的变更,并提供改进意见:

1. 语法逻辑

代码的语法逻辑基本正确,没有明显的逻辑错误。主要变更包括:

  • 在 myDeviceLayout 中添加了边距设置 setContentsMargins(0, 0, 0, 0)
  • 将 mainLayout 的间距从 5 调整为 4

2. 代码质量

  • 代码质量良好,变更合理
  • 添加边距设置有助于统一界面风格,避免不必要的空白
  • 间距微调可能是为了视觉上的对齐和美观

3. 代码性能

  • 这些变更对性能影响极小,主要是UI布局的微调
  • 边距和间距的调整不会影响运行时性能

4. 代码安全

  • 代码安全方面没有问题
  • 这些变更都是UI相关的,不会引入安全风险

改进建议:

  1. 建议将魔法数字(如间距值4)定义为命名常量,例如:

    static const int DEFAULT_SPACING = 4;
    static const int DEFAULT_MARGIN = 0;

    这样便于后续维护和统一修改

  2. 考虑将这些UI常量集中管理,可以创建一个UI配置类或使用枚举来管理所有UI相关的尺寸值

  3. 如果这些UI调整是为了适配特定设计规范,建议添加注释说明调整的原因,例如:

    // 调整间距以匹配设计规范中的4px标准间距
    mainLayout->addSpacing(4);

总体而言,这些代码变更合理且安全,主要是UI布局的微调,有助于改善界面显示效果。建议按照上述建议进行代码优化,提高代码的可维护性。

@wjyrich wjyrich merged commit 6e4aa2f into linuxdeepin:master Aug 28, 2025
8 of 9 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