Skip to content

Normal/Hover/Focus PseudoClasses for TextEdit & LineEdit#6558

Open
Aeshus wants to merge 3 commits into
space-wizards:masterfrom
Aeshus:pseudoclasses
Open

Normal/Hover/Focus PseudoClasses for TextEdit & LineEdit#6558
Aeshus wants to merge 3 commits into
space-wizards:masterfrom
Aeshus:pseudoclasses

Conversation

@Aeshus
Copy link
Copy Markdown
Contributor

@Aeshus Aeshus commented May 8, 2026

About the PR

There are new Normal/Hover/Focus/NotEditable pseudoclasses available within TextEdit/LineEdit (alongside Placeholder).

Why / Balance

I wanted to style TextEdit/LineEdit more in content.

There's no way to style in Content when a TextEdit/LineEdit is being hovered or being edited, so this now lets you style it.

Media

New (style changes to show behavior):
new-updated.mp4
New (no style changes):
new.mp4
Old:
old.mp4

Migration(s)

No breaking style changes unless there are badly written stylerules, such as in space-wizards/space-station-14#43908.

Changes

New obsolete warning on using LineEdit's StylePseudoClassNotEditable instead of StylePseudoClassLineEditNotEditable, though support for it is still implemented.

KeyboardFocused is now cleared before calling KeyboardFocusExited() so it can be used for pseudoclass styling.

  • (I couldn't find anything that this broke, but I'm not 100% sure. If needed, we can just revert this change and add a new field like Hover to handle that stuff.)

Support for Normal/Hover/Focus/NotEditable pseudoclasses that are mutually exclusive and can compose with the Placeholder Pseudoclass.

Aeshus added 3 commits May 8, 2026 16:57
I don't think this breaks any code, and now you can rely on
KeyboardFocused() to tell if you're taking user input for style purposes
If TextEdit uses NotEditable, might as well use it here too. It's also
now the same as the old StyleClass but a PseudoClass
@Aeshus Aeshus requested review from DrSmugleaf and PJB3005 as code owners May 8, 2026 22:20
@PJB3005 PJB3005 added T: New Feature Type: New feature A: UI Things like game screens, menus, and windows. labels May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: UI Things like game screens, menus, and windows. T: New Feature Type: New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants