Skip to content

fix(wireless): fix title font weight and color for My/Other Networks#588

Merged
caixr23 merged 1 commit into
linuxdeepin:masterfrom
iCancely:fix/wireless-title-font-and-color
Jul 27, 2026
Merged

fix(wireless): fix title font weight and color for My/Other Networks#588
caixr23 merged 1 commit into
linuxdeepin:masterfrom
iCancely:fix/wireless-title-font-and-color

Conversation

@iCancely

@iCancely iCancely commented Jul 27, 2026

Copy link
Copy Markdown
Contributor
  1. Change "My Networks" title font weight from bold to Font.Medium
  2. Change "Other Networks" title font weight from bold to Font.Medium, keep t6 font size
  3. Apply DccTitleObject-style palette color (rgba 0.9 alpha) to both titles to match "My Hotspot"

Log: Fix wireless page section titles font weight and color to match hotspot title style
Influence: Section titles now match hotspot title style

fix(wireless): 修复无线网络"我的网络"和"其他网络"标题字重和颜色

  1. 将"我的网络"标题字重从 bold 改为 Font.Medium
  2. 将"其他网络"标题字重从 bold 改为 Font.Medium,保持 t6 字号不变
  3. 为两个标题应用与"我的热点"一致的 DccTitleObject 调色板颜色(rgba 0.9 透明度)

Log: 修复无线网络页面分区标题字重和颜色与热点标题不一致的问题
PMS: BUG-371529
Influence: 标题样式与个人热点模块保持一致

Summary by Sourcery

Align wireless page section titles and airplane mode page header styling with the hotspot title and global typography guidelines.

Bug Fixes:

  • Correct font weight and color for "My Networks" and "Other Networks" titles to match hotspot styling.
  • Ensure airplane mode page header uses the appropriate font size and padding for consistent layout.

Enhancements:

  • Apply shared palette-based title colors for wireless section labels to improve visual consistency across themes.

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 总体评价

代码修复了UI样式问题并完善了暗黑模式颜色适配,逻辑严谨且符合设计规范。
语法正确、质量良好且无安全漏洞,因此获得满分。

■ 详细分析

  • 1.语法逻辑完全正确✓

在 PageAirplane.qml 中正确添加了 font.pixelSize 和 leftPadding 属性。在 PageWirelessDevice.qml 中将字体属性从 "bold": true 修改为 "weight": Font.Medium,符合 QML 字体属性设置规范。D.Palette 和 D.ColorSelector 的绑定语法完全正确。
潜在问题:无
建议:无

  • 2.代码质量良好✓

代码修改精确地修复了字体粗细和暗黑模式下的文字颜色适配问题,注释清晰说明了修改目的。虽然 PageWirelessDevice.qml 中存在两段相似的 D.Palette 定义,但这是 QML 声明式语言的常见模式,且通过不同的 id 进行了区分,整体可读性良好。
潜在问题:存在轻微的代码重复
建议:可考虑将通用的标题颜色 Palette 提取为独立的公共组件或在文件顶部统一定义,以减少重复代码。

  • 3.代码性能无性能问题✓

修改仅涉及静态属性绑定和简单的颜色对象声明,不涉及复杂的计算、循环或高频事件处理,不会对渲染性能产生负面影响。
潜在问题:无
建议:无

  • 4.代码安全存在0个安全漏洞✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改为纯 UI 样式调整,不涉及任何外部输入处理、网络通信、文件操作或敏感权限调用,不存在可利用的攻击面。

  • 建议:无需额外安全修复措施。

■ 改进建议代码示例

// 为了减少 PageWirelessDevice.qml 中的代码重复,可将颜色定义提取至顶层或使用公共组件
// 以下是提取公共 Palette 的优化示例

// 在文件顶部或公共 QML 文件中定义
/*
D.Palette {
    id: titleTextColor
    normal: Qt.rgba(0, 0, 0, 0.9)
    normalDark: Qt.rgba(1, 1, 1, 0.9)
}
*/

// 在 PageWirelessDevice.qml 中的使用示例
pageType: DccObject.Item
page: Label {
    font: DccUtils.copyFont(D.DTK.fontManager.t5, {
                                "weight": Font.Medium
                            })
    text: dccObj.displayName
    color: D.ColorSelector.textColor
    // 直接引用顶层定义的 Palette,避免在每个 Label 中重复声明
    property D.Palette textColor: titleTextColor 
}

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

  • In both Label definitions the D.Palette (mineTitleColor/otherTitleColor) and property D.Palette textColor are never actually used by the color binding (color: D.ColorSelector.textColor), so either bind color to the new palette or remove the unused palette-related code to avoid confusion.
  • The same palette and font-weight styling logic for "My Networks" and "Other Networks" is duplicated; consider extracting this into a shared helper or component to keep the section title styling consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In both Label definitions the `D.Palette` (`mineTitleColor`/`otherTitleColor`) and `property D.Palette textColor` are never actually used by the `color` binding (`color: D.ColorSelector.textColor`), so either bind `color` to the new palette or remove the unused palette-related code to avoid confusion.
- The same palette and font-weight styling logic for "My Networks" and "Other Networks" is duplicated; consider extracting this into a shared helper or component to keep the section title styling consistent and easier to maintain.

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.

1. Change "My Networks" title font weight from bold to Font.Medium
2. Change "Other Networks" title font weight from bold to Font.Medium, keep t6 font size
3. Apply DccTitleObject-style palette color (rgba 0.9 alpha) to both titles to match "My Hotspot"

Log: Fix wireless page section titles font weight and color to match hotspot title style
Influence: Section titles now match hotspot title style

fix(wireless): 修复无线网络"我的网络"和"其他网络"标题字重和颜色

1. 将"我的网络"标题字重从 bold 改为 Font.Medium
2. 将"其他网络"标题字重从 bold 改为 Font.Medium,保持 t6 字号不变
3. 为两个标题应用与"我的热点"一致的 DccTitleObject 调色板颜色(rgba 0.9 透明度)

Log: 修复无线网络页面分区标题字重和颜色与热点标题不一致的问题
PMS: BUG-371529
Influence: 标题样式与个人热点模块保持一致
@caixr23
caixr23 force-pushed the fix/wireless-title-font-and-color branch from 6756e88 to 06f67ca Compare July 27, 2026 07:15
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@caixr23
caixr23 merged commit 2a6b3e8 into linuxdeepin:master Jul 27, 2026
14 of 16 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