Skip to content

gpui: Fix text hover & active style#24723

Merged
mikayla-maki merged 14 commits intozed-industries:mainfrom
huacnlee:fix-text-hover-style
Apr 10, 2025
Merged

gpui: Fix text hover & active style#24723
mikayla-maki merged 14 commits intozed-industries:mainfrom
huacnlee:fix-text-hover-style

Conversation

@huacnlee
Copy link
Contributor

@huacnlee huacnlee commented Feb 12, 2025

Release Notes:

  • N/A

Fix this long-standing issue so that we can support Link hover colors.

And renamed text_layout example to text_style.


I spent some time studying the process of this text style change and found it a bit complicated.

At first, I thought there was a problem with refine and it was not passed properly. After changing it, I found that it was not the problem.

Then I found that it was because TextRun had already stored the color, background, underline, strikethrough in TextRun in the request_layout stage. They area calculate at the request_layout stage, but request_layout stage there was no hitbox, so the hover state was not obtained.

cargo run -p gpui --example text_style
CleanShot.2025-03-15.at.19.11.52.mp4

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 12, 2025
@huacnlee huacnlee force-pushed the fix-text-hover-style branch from fd42ddd to 1e16283 Compare February 13, 2025 02:43
@huacnlee huacnlee marked this pull request as ready for review February 13, 2025 02:56
@mikayla-maki mikayla-maki self-assigned this Mar 14, 2025
@huacnlee huacnlee changed the title gpui: Fix text hover style gpui: Fix text hover & active style Mar 15, 2025
@huacnlee huacnlee force-pushed the fix-text-hover-style branch from 90aa6d6 to 7d19c45 Compare March 15, 2025 11:16
Copy link
Member

@mikayla-maki mikayla-maki left a comment

Choose a reason for hiding this comment

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

This looks great! Just one small note, if you could merge main and get CI passing I'd be happy to merge this :)

@mikayla-maki mikayla-maki enabled auto-merge (squash) April 10, 2025 22:18
@mikayla-maki mikayla-maki merged commit ffdf725 into zed-industries:main Apr 10, 2025
17 checks passed
mikayla-maki added a commit that referenced this pull request Apr 11, 2025
@mikayla-maki mikayla-maki mentioned this pull request Apr 11, 2025
mikayla-maki added a commit that referenced this pull request Apr 11, 2025
Earlier, I merged #24723

Before merging it, I made a change that was incorrect and fast followed
with a fix: #28548

Following that fix, @bennetbo discovered that the modals where no longer
highlighting correctly, particularly the outline modal.

So I'm going to revert it all.

Release Notes:

- N/A
tmickleydoyle pushed a commit that referenced this pull request Apr 14, 2025
Earlier, I merged #24723

Before merging it, I made a change that was incorrect and fast followed
with a fix: #28548

Following that fix, @bennetbo discovered that the modals where no longer
highlighting correctly, particularly the outline modal.

So I'm going to revert it all.

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants