Skip to content

fix: Fix the issue where disabled modules are not grayed out#2910

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix-345387
Dec 29, 2025
Merged

fix: Fix the issue where disabled modules are not grayed out#2910
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix-345387

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Dec 26, 2025

Copy link
Copy Markdown
Contributor

Fix the issue where disabled modules are not grayed out

Log: Fix the issue where disabled modules are not grayed out
pms: BUG-345387

Summary by Sourcery

Bug Fixes:

  • Gray out the mouse cursor size control when it is disabled to match its enabled state.

@sourcery-ai

sourcery-ai Bot commented Dec 26, 2025

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

Reviewer's Guide

Adds opacity binding to the mouse size control so that it visually reflects the enabled/disabled state by graying out when disabled.

Flow diagram for opacity binding of mouse size control

flowchart TD
  A[MouseSizeControl created] --> B{enabled state}
  B -->|true| C[Set opacity to 1]
  B -->|false| D[Set opacity to 0.4]
  C --> E[Control appears fully active]
  D --> F[Control appears grayed out]
Loading

File-Level Changes

Change Details Files
Bind the opacity of the mouse size control to its enabled state so disabled modules appear grayed out.
  • Introduce an opacity property binding that sets full opacity when enabled and partial opacity when disabled on the mouse size UI component
  • Ensure the grayed-out visual feedback is tied directly to the existing enabled property without altering other layout or behavior
src/plugin-mouse/qml/Mouse.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

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

  • Consider replacing the hardcoded 0.4 opacity with a shared constant or theme value so the disabled appearance remains consistent with other controls and can be tuned centrally.
  • If this control has child items that also have their own opacity bindings, double-check that the parent-level opacity change will not conflict with or override any intended visual states for those children.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider replacing the hardcoded `0.4` opacity with a shared constant or theme value so the disabled appearance remains consistent with other controls and can be tuned centrally.
- If this control has child items that also have their own `opacity` bindings, double-check that the parent-level opacity change will not conflict with or override any intended visual states for those children.

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.

Fix the issue where disabled modules are not grayed out

Log: Fix the issue where disabled modules are not grayed out
pms: BUG-345387
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这段代码变更进行审查:

  1. 语法逻辑:
  • 新增的 opacity: enabled ? 1 : 0.4 语法正确,使用了三元运算符来控制透明度
  • 逻辑清晰:当控件启用时完全不透明,禁用时变为40%不透明度
  • 这是一个很好的视觉反馈机制,符合UI设计规范
  1. 代码质量:
  • 代码简洁明了,没有冗余
  • 遵循了QML的属性声明风格
  • 建议考虑将这个透明度值(0.4)定义为常量,便于统一管理和修改
  1. 代码性能:
  • 这个改动对性能影响很小,只是添加了一个简单的属性绑定
  • opacity属性的变化会触发重绘,但由于只是简单的透明度变化,性能开销可忽略
  1. 代码安全:
  • 这段代码没有安全风险
  • 不涉及任何用户输入或数据处理

改进建议:

  1. 可以考虑将透明度值定义为常量:
readonly property real disabledOpacity: 0.4
opacity: enabled ? 1 : disabledOpacity
  1. 如果这个透明度效果在多处使用,建议创建一个自定义组件或使用Qt的Control样式系统来统一管理禁用状态的样式。

  2. 可以考虑添加过渡动画,使透明度变化更平滑:

Behavior on opacity {
    NumberAnimation { duration: 200 }
}

总的来说,这是一个很好的改进,提升了用户体验,代码质量良好。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@pengfeixx

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Dec 29, 2025

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 0b4ccd0 into linuxdeepin:master Dec 29, 2025
16 of 18 checks passed
@pengfeixx pengfeixx deleted the fix-345387 branch December 29, 2025 02:44
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