zed/crates/gpui
Marshall Bowers 71c1e36d1e
Put Theme behind an Arc (#3017)
This PR puts the `Theme` returned from the `theme` function behind an
`Arc`.

### Motivation

While working on wiring up window focus events for the `TitleBar`
component we ran into issues where `theme` was holding an immutable
borrow to the `ViewContext` for the entirety of the `render` scope,
which prevented having mutable borrows in the same scope.

### Explanation

To avoid this, we can make `theme` return an `Arc<Theme>` to allow for
cheap clones and avoiding the issues with the borrow checker.

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-09-22 13:35:30 -04:00
..
examples Eliminate PaintContext 2023-09-11 09:00:59 -06:00
src Put Theme behind an Arc (#3017) 2023-09-22 13:35:30 -04:00
tests Merge branch 'main' into divs 2023-08-22 16:35:56 -06:00
build.rs Use a hand-coded parser for keymap context predicates 2023-01-16 15:53:49 -08:00
Cargo.toml Make cargo test -p gpui work 2023-09-15 10:24:12 -06:00