gpui: Add support for window transparency & blur on macOS (#9610)
This PR adds support for transparent and blurred window backgrounds on macOS. Release Notes: - Added support for transparent and blurred window backgrounds on macOS ([#5040](https://github.com/zed-industries/zed/issues/5040)). - This requires themes to specify a new `background.appearance` key ("opaque", "transparent" or "blurred") and to include an alpha value in colors that should be transparent. <img width="913" alt="image" src="https://github.com/zed-industries/zed/assets/2588851/7547ee2a-e376-4d55-9114-e6fc2f5110bc"> <img width="994" alt="image" src="https://github.com/zed-industries/zed/assets/2588851/b36fbc14-6e4d-4140-9448-69cad803c45a"> <img width="1020" alt="image" src="https://github.com/zed-industries/zed/assets/2588851/d70e2005-54fd-4991-a211-ed484ccf26ef"> --------- Co-authored-by: Luiz Marcondes <luizgustavodevergennes@gmail.com> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
1360dffead
commit
49144d94bf
20 changed files with 173 additions and 17 deletions
|
@ -208,12 +208,21 @@ fn main() {
|
|||
watch_file_types(fs.clone(), cx);
|
||||
|
||||
languages.set_theme(cx.theme().clone());
|
||||
|
||||
cx.observe_global::<SettingsStore>({
|
||||
let languages = languages.clone();
|
||||
let http = http.clone();
|
||||
let client = client.clone();
|
||||
|
||||
move |cx| {
|
||||
for &mut window in cx.windows().iter_mut() {
|
||||
let background_appearance = cx.theme().window_background_appearance();
|
||||
window
|
||||
.update(cx, |_, cx| {
|
||||
cx.set_background_appearance(background_appearance)
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
languages.set_theme(cx.theme().clone());
|
||||
let new_host = &client::ClientSettings::get_global(cx).server_url;
|
||||
if &http.base_url() != new_host {
|
||||
|
|
|
@ -34,6 +34,7 @@ use task::{
|
|||
oneshot_source::OneshotSource,
|
||||
static_source::{StaticSource, TrackedFile},
|
||||
};
|
||||
use theme::ActiveTheme;
|
||||
|
||||
use terminal_view::terminal_panel::{self, TerminalPanel};
|
||||
use util::{
|
||||
|
@ -104,6 +105,7 @@ pub fn build_window_options(display_uuid: Option<Uuid>, cx: &mut AppContext) ->
|
|||
is_movable: true,
|
||||
display_id: display.map(|display| display.id()),
|
||||
fullscreen: false,
|
||||
window_background: cx.theme().window_background_appearance(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue