Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Apr 7, 2025

windowText is not opacity for most Control, so we change the
windowText of root Control.

pms: BUG-311111

Summary by Sourcery

Fix incorrect window text color for OSD (On-Screen Display) controls

Bug Fixes:

  • Corrected the window text color for OSD controls to ensure proper text visibility across different themes and color palettes

Enhancements:

  • Added a custom text color palette to improve text readability in OSD components

windowText is not opacity for most Control, so we change the
windowText of root Control.

pms: BUG-311111
@sourcery-ai
Copy link

sourcery-ai bot commented Apr 7, 2025

Reviewer's Guide by Sourcery

This pull request fixes an issue where the windowText color role was not being applied correctly for OSD. The windowText property is now applied to the root Control in the OSD, and the windowText color role is set for the description label in the windoweffect OSD.

Updated class diagram for OSD main.qml

classDiagram
  class Window {
    isSingleView: bool
    osdView: Item
  }
  class Control {
    Palette textColor
    Repeater appletItems
  }
  class Palette {
    Color normal
    Color normalDark
  }
  class Color {
  }
  Window -- Control : contains
  Control -- Palette : has
Loading

File-Level Changes

Change Details Files
Applied the windowText color role to the root Control instead of the Window.
  • Wrapped the Repeater in a Control.
  • Set the palette.windowText property of the Control to D.ColorSelector.textColor.
panels/notification/osd/package/main.qml
Set the windowText color role for the description label in the windoweffect OSD.
  • Added palette.windowText: D.DTK.palette.windowText to the description label.
panels/notification/osd/windoweffect/package/main.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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

代码审查意见:

  1. main.qml文件中,Repeater组件内的Loaderactive属性绑定到modelData.update(Applet.osdType),这可能会导致不必要的更新,因为update方法可能会改变modelData的状态。建议检查update方法的实现,确保它不会导致不必要的重渲染。

  2. main.qml文件中,Control组件的palette.windowText属性被设置为D.ColorSelector.textColor,但是没有提供D.ColorSelector.textColor的定义。需要确保D.ColorSelector.textColor在代码的其他部分有定义,否则会导致运行时错误。

  3. main.qml文件中,Repeater组件内的LoaderonActiveChanged信号处理程序中,当active属性变为true时,root.isSingleViewroot.osdView被更新。这可能会导致isSingleViewosdView的频繁更新,如果Applet.appletItems的长度很大,可能会影响性能。建议考虑是否有必要在每次active变化时都更新这些属性,或者是否可以通过其他方式优化。

  4. main.qml文件中,Control组件的palette.windowText属性被设置为D.DTK.palette.windowText,但是没有提供D.DTK.palette.windowText的定义。需要确保D.DTK.palette.windowText在代码的其他部分有定义,否则会导致运行时错误。

  5. windoweffect/package/main.qml文件中,D.Label组件的palette.windowText属性被设置为D.DTK.palette.windowText,但是没有提供D.DTK.palette.windowText的定义。需要确保D.DTK.palette.windowText在代码的其他部分有定义,否则会导致运行时错误。

  6. windoweffect/package/main.qml文件中,D.Label组件的Layout.maximumWidth属性被设置为298,但是没有提供298的具体含义。建议提供注释或者使用常量来定义这个值,以便于理解和维护代码。

总体来说,代码的修改看起来是合理的,但是需要确保所有使用的属性和变量都有正确的定义,并且考虑性能和可维护性。

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 @18202781743 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider whether the textColor property should be defined outside of the Control block for better organization.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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: 18202781743, mhduiy

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
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Apr 7, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 05510e8 into linuxdeepin:master Apr 7, 2025
7 of 10 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