Skip to content

Add different color for unfocused selected editable text#23947

Merged
alice-i-cecile merged 3 commits intobevyengine:mainfrom
Zeophlite:unfocused-selection
Apr 23, 2026
Merged

Add different color for unfocused selected editable text#23947
alice-i-cecile merged 3 commits intobevyengine:mainfrom
Zeophlite:unfocused-selection

Conversation

@Zeophlite
Copy link
Copy Markdown
Contributor

Objective

Solution

  • Added unfocused_selection_color: Color to TextCursorStyle

Testing

  • cargo run --example multiple_text_inputs
Screenshot 2026-04-23 at 10 07 43 pm
  • cargo run --example feathers_gallery --features="experimental_bevy_feathers"
Screenshot 2026-04-23 at 10 11 46 pm

@Zeophlite Zeophlite added A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 23, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI Apr 23, 2026
@Zeophlite Zeophlite added this to the 0.19 milestone Apr 23, 2026
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Self {
color: RED.into(),
selection_color: Color::from(GREEN),
unfocused_selection_color: Color::from(BLUE),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defaults don't matter too much here, but the blue is a bit too prominent, they should be chosen to suggest which is the focused input. Maybe just same as the selection color but with 0.5 alpha or something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should try and pick decent defaults for all of these colors. I'll make a follow-up once this is in.

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 23, 2026
Copy link
Copy Markdown
Contributor

@jordanhalase jordanhalase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, could this be invisible rather than a lighter accent color? For HTML inputs the selection turns invisible out of focus by default, and I think more people will expect it that way unless they are writing something like a code editor where they expect to still see their highlighting when clicked off.

I do not feel very strongly about this, but I imagine users would not prefer to see highlighting retained when clicking between many small inconsequential text/number inputs, and to reserve that behavior for larger more "important" text inputs.

Comment thread crates/bevy_feathers/src/dark_theme.rs Outdated
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 23, 2026
Merged via the queue into bevyengine:main with commit 58e91dd Apr 23, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in UI Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Text input should hide text highlighting when focus lost

6 participants