# gpui: Fix text hover & active style \(\#24723\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ffdf725f32404d17827dc5cd38852c13b3fe8012)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ffdf725f32404d17827dc5cd38852c13b3fe8012

Requested commit: ffdf725f32404d17827dc5cd38852c13b3fe8012

Commit: ffdf725f32404d17827dc5cd38852c13b3fe8012

Tree: 32effa4fe6cf21b8b797339533ea18179f5cded5

Author: Jason Lee

Committer: GitHub

## Message

````
gpui: Fix text hover & active style (#24723)

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.

```bash
cargo run -p gpui --example text_style
```


https://github.com/user-attachments/assets/24f88f73-775e-41d3-a502-75a7a39ac82b

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
````

## Parents

- [8ee6a2b4547d7c3f4dcb59526dc2c50c73a37f20](https://git.cafe/gitcafe/zed/commit/8ee6a2b4547d7c3f4dcb59526dc2c50c73a37f20?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ffdf725f32404d17827dc5cd38852c13b3fe8012?format=markdown)
