Files
oak-gpui/crates
Marshall Bowers 5b8bb6237f Scale UI elements in the editor based on the buffer_font_size (#11817)
This PR adjusts how UI elements are rendered inside of full-size editors
to scale with the configured `buffer_font_size`.

This fixes some issues where UI elements (such as the `IconButton`s used
for code action and task run indicators) would not scale as the
`buffer_font_size` was changed.

We achieve this by changing the rem size when rendering the
`EditorElement`, with a rem size that is derived from the
`buffer_font_size`.

`WindowContext` now has a new `with_rem_size` method that can be used to
render an element with a given rem size. Note that this can only be
called during `request_layout`, `prepaint`, or `paint`, similar to
`with_text_style` or `with_content_mask`.

### Before

<img width="1264" alt="Screenshot 2024-05-14 at 2 15 39 PM"
src="https://github.com/zed-industries/zed/assets/1486634/05ad7f8d-c62f-4baa-bffd-38cace7f3710">

<img width="1264" alt="Screenshot 2024-05-14 at 2 15 49 PM"
src="https://github.com/zed-industries/zed/assets/1486634/254cd11c-3723-488f-ab3d-ed653169056c">

### After

<img width="1264" alt="Screenshot 2024-05-14 at 2 13 02 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c8dad309-62a4-444f-bfeb-a0009dc08c03">

<img width="1264" alt="Screenshot 2024-05-14 at 2 13 06 PM"
src="https://github.com/zed-industries/zed/assets/1486634/4d9a3a52-9656-4768-b210-840b4884e381">

Note: This diff is best viewed with whitespace changes hidden:

<img width="245" alt="Screenshot 2024-05-14 at 2 22 45 PM"
src="https://github.com/zed-industries/zed/assets/1486634/7cb9829f-9c1b-4224-95be-82182017ed90">

Release Notes:

- Changed UI elements within the editor to scale based on
`buffer_font_size` (e.g., code action indicators, task run indicators,
etc.).
2024-05-14 14:34:39 -04:00
..
2024-05-10 15:50:20 -06:00
2024-05-10 15:50:20 -06:00
2024-05-09 21:08:49 -06:00
2024-05-10 15:50:20 -06:00
2024-04-23 13:31:21 -04:00
2024-05-10 15:50:20 -06:00
2024-04-11 15:36:35 -06:00
2024-05-10 15:50:20 -06:00
2024-04-30 23:31:59 -06:00
2024-05-10 15:50:20 -06:00
2024-05-10 15:50:20 -06:00
2024-05-09 21:08:49 -06:00
2024-04-26 13:25:25 -06:00
2024-05-09 21:08:49 -06:00
2024-05-06 12:58:11 +02:00
2024-05-13 17:58:08 -04:00
2024-05-10 15:50:20 -06:00
2024-05-05 15:02:50 +02:00
2024-04-15 14:21:52 +02:00
2024-05-10 15:50:20 -06:00
2024-05-11 14:04:05 -04:00
2024-05-03 12:50:42 -07:00