Skip to content

fix: Apply the list module text color and hover effect adjustments#552

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-314399
May 9, 2025
Merged

fix: Apply the list module text color and hover effect adjustments#552
BLumia merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-bug-314399

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented May 8, 2025

update when hovered, app palette from 70% to 100%

pms-bug-314399

Summary by Sourcery

Adjust text color opacity for list module items to improve visual appearance

Bug Fixes:

  • Fix text visibility in AppListView and FreeSortListView by implementing dynamic text opacity

Enhancements:

  • Modify text color to have 70% opacity when not hovered, and 100% opacity when hovered in list views

Copy link
Copy Markdown

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

  • The text color hover logic is duplicated; consider centralizing this behavior for AppListView.qml and FreeSortListView.qml.
  • In AppListView.qml, the base text color source changed from ListView.view.palette.brightText to parent.palette.brightText; please verify this was intended.
  • Consider using Qt.alpha(color, alphaValue) for a more concise way to set color opacity instead of reconstructing it with Qt.rgba().
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.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 8, 2025

Reviewer's Guide

This PR implements dynamic text opacity for list items in AppListView.qml and FreeSortListView.qml. This is achieved by conditionally setting the palette.windowText property: for hovered items, parent.palette.brightText (full opacity) is used, while for non-hovered items, Qt.rgba is employed to set the alpha channel of parent.palette.brightText to 0.7, resulting in 70% opacity.

File-Level Changes

Change Details Files
Introduced dynamic text opacity for list items: 70% by default, 100% on hover.
  • Modified palette.windowText to be determined by a conditional (ternary) operator based on the hovered state.
  • When not hovered, text color is set using Qt.rgba with the RGB components of parent.palette.brightText and an alpha value of 0.7.
  • When hovered, text color is set directly to parent.palette.brightText for full opacity.
qml/windowed/AppListView.qml
qml/windowed/FreeSortListView.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

@18202781743
Copy link
Copy Markdown
Contributor

update when hovered, app palette from 70% to 100%

pms-bug-314399
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. 重复代码

    • AppListView.qmlFreeSortListView.qml文件中,ColorSelector.pressed: falseproperty Palette textColor: DStyle.Style.button.text被重复添加。建议将这些重复的代码提取到一个公共的组件或函数中,以减少代码冗余。
  2. 颜色选择器状态

    • ColorSelector.pressed: false被设置为false,但未看到相关的逻辑来处理pressed状态的变化。如果pressed状态有特定的用途,建议添加相应的逻辑处理。
  3. 文本颜色属性

    • property Palette textColor: DStyle.Style.button.text定义了一个新的属性textColor,但未看到在代码中如何使用这个属性。如果这个属性是用于动态改变文本颜色,建议在代码中添加相应的逻辑。
  4. 颜色选择器文本颜色

    • palette.windowText: ColorSelector.textColor使用了ColorSelector.textColor作为windowText的颜色。如果ColorSelector.textColor的值可能会变化,建议添加相应的监听器来动态更新windowText的颜色。
  5. 工具提示延迟

    • ToolTip.delay: 500设置了一个固定的延迟时间。如果这个延迟时间是根据用户行为动态变化的,建议使用变量来代替固定的值。
  6. 可见性逻辑

    • visible: !Drag.active中的Drag.active可能是一个全局变量或状态,如果这个状态的变化会影响其他组件的可见性,建议添加相应的注释说明。
  7. 代码风格

    • 虽然代码改动不大,但建议保持代码风格的一致性,例如缩进和空格的使用。

综上所述,建议对重复代码进行提取,处理pressed状态的变化,使用动态属性,添加相应的监听器,以及保持代码风格的一致性。

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 e131bda into linuxdeepin:master May 9, 2025
7 of 10 checks passed
@wjyrich wjyrich deleted the fix-bug-314399 branch June 6, 2025 00:36
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.

4 participants