Merge branch 'main' into zed2-workspace
This commit is contained in:
@@ -47,8 +47,8 @@ where
|
||||
subscribers.remove(&subscriber_id);
|
||||
if subscribers.is_empty() {
|
||||
lock.subscribers.remove(&emitter_key);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// We didn't manage to remove the subscription, which means it was dropped
|
||||
|
||||
@@ -352,9 +352,12 @@ impl<V: Render> From<View<V>> for AnyView {
|
||||
initialize: |view, cx| {
|
||||
cx.with_element_id(view.model.entity_id, |_, cx| {
|
||||
let view = view.clone().downcast::<V>().unwrap();
|
||||
Box::new(AnyElement::new(
|
||||
view.update(cx, |view, cx| Render::render(view, cx)),
|
||||
))
|
||||
let element = view.update(cx, |view, cx| {
|
||||
let mut element = AnyElement::new(view.render(cx));
|
||||
element.initialize(view, cx);
|
||||
element
|
||||
});
|
||||
Box::new(element)
|
||||
})
|
||||
},
|
||||
layout: |view, element, cx| {
|
||||
|
||||
@@ -571,6 +571,12 @@ impl<'a> WindowContext<'a> {
|
||||
self.window.rem_size
|
||||
}
|
||||
|
||||
/// Sets the size of an em for the base font of the application. Adjusting this value allows the
|
||||
/// UI to scale, just like zooming a web page.
|
||||
pub fn set_rem_size(&mut self, rem_size: impl Into<Pixels>) {
|
||||
self.window.rem_size = rem_size.into();
|
||||
}
|
||||
|
||||
/// The line height associated with the current text style.
|
||||
pub fn line_height(&self) -> Pixels {
|
||||
let rem_size = self.rem_size();
|
||||
|
||||
Reference in New Issue
Block a user