Skip to content

fix(ActionButton): add hover and pressed color states for icon in input fields - #724

Merged
18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/action-button-hover-pressed-color
Oct 16, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:v25-flowstylefrom
iCancely:fix/action-button-hover-pressed-color

Conversation

@iCancely

@iCancely iCancely commented Oct 16, 2026 •

Copy link
Copy Markdown

Changes

  • hover: icon color becomes opaque foreground (alpha 1.0)
  • pressed: icon color becomes active highlight color
  • palette.windowText now always bound to D.ColorSelector.textColor so the palette system picks up all states automatically (previously only bound on pressed, hover was undefined)
  • Adapts to light/dark themes via the palette system, no explicit normalDark/hoveredDark needed

Rationale

The ActionButton used inside LineEdit / PasswordEdit (clear button, echo toggle) had no icon color change on hover. This follows the same pattern already established in DS.Style.comboBox.flatText (normal 70% alpha, hovered opaque, pressed highlight).

Scope

Only qt6/src/qml/ActionButton.qml is modified.

Summary by Sourcery

Add responsive, theme-aware icon colors to ActionButton controls in input fields.

New Features:

  • Add theme-aware hover and pressed icon color states for ActionButton controls used in input fields.

Bug Fixes:

  • Ensure ActionButton icons visibly respond to hover and pressed interactions instead of lacking a hover state.

Enhancements:

  • Bind the button palette text color consistently so all control states are resolved through the palette system.

…ut fields

- hover: icon color becomes opaque foreground (alpha 1.0)
- pressed: icon color becomes active highlight color
- palette.windowText now always bound to ColorSelector.textColor
  so the palette system picks up all states automatically
- adapts to light/dark themes via the palette system
@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

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

Reviewer's Guide

Updates ActionButton’s palette configuration so icons in input-field controls transition from subdued in the normal state to opaque on hover and the active highlight color when pressed, with light/dark theme behavior handled by the existing palette system.

State diagram for ActionButton icon color states

stateDiagram-v2
    [*] --> Normal
    Normal --> Hovered: pointer enters
    Hovered --> Normal: pointer leaves
    Hovered --> Pressed: press
    Pressed --> Hovered: release
    Normal: textColor.common = alpha 0.7
    Hovered: textColor.common = alpha 1.0
    Pressed: textColor = D.DTK.makeColor(D.Color.Highlight)
Loading

File-Level Changes

Change Details Files
Define state-aware icon text colors and bind the button palette to the selector so hover and pressed states resolve through the theme palette system.
  • Set normal icon color to 70% opaque black and hovered color to fully opaque black.
  • Use the theme highlight color for the pressed state.
  • Keep palette.windowText continuously bound to D.ColorSelector.textColor, allowing palette-driven state and light/dark theme adaptation.
qt6/src/qml/ActionButton.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 reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@iCancely

Copy link
Copy Markdown
Author

@18202781743

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@18202781743
18202781743 merged commit 984acd0 into linuxdeepin:v25-flowstyle Oct 16, 2026
18 of 20 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