forked from reya/gpui-native-kit
chore: reduce component overhead (#3)
Reviewed-on: reya/gpui-native-kit#3
This commit is contained in:
@@ -74,9 +74,7 @@ fn the_pill_bar_pads_for_traffic_lights_when_it_leads_the_window() {
|
||||
let mut cx = TestAppContext::single();
|
||||
let (dock, mut visual) = dock_window(false, false, &mut cx);
|
||||
cx.update(|cx| {
|
||||
dock.update(cx, |dock, cx| {
|
||||
dock.register_panel(descriptor("overview"), cx)
|
||||
});
|
||||
dock.update(cx, |dock, _cx| dock.register_panel(descriptor("overview")));
|
||||
});
|
||||
open(&mut visual, &dock, "overview");
|
||||
|
||||
@@ -87,9 +85,7 @@ fn the_pill_bar_pads_for_traffic_lights_when_it_leads_the_window() {
|
||||
let (dock, mut visual) = dock_window(false, true, &mut cx);
|
||||
let _ = &dock;
|
||||
cx.update(|cx| {
|
||||
dock.update(cx, |dock, cx| {
|
||||
dock.register_panel(descriptor("overview"), cx)
|
||||
});
|
||||
dock.update(cx, |dock, _cx| dock.register_panel(descriptor("overview")));
|
||||
});
|
||||
open(&mut visual, &dock, "overview");
|
||||
|
||||
@@ -101,11 +97,11 @@ fn the_pill_bar_pads_for_traffic_lights_when_it_leads_the_window() {
|
||||
// The bare bar keeps the standard leading padding; the padded bar clears
|
||||
// the traffic lights.
|
||||
assert!(
|
||||
bare_inset < px(TRAFFIC_LIGHT_PAD),
|
||||
bare_inset < TRAFFIC_LIGHT_PAD,
|
||||
"the bare bar must not reserve the traffic-light pad (bare {bare_inset:?})"
|
||||
);
|
||||
assert!(
|
||||
padded_inset >= px(TRAFFIC_LIGHT_PAD) - px(1.),
|
||||
padded_inset >= TRAFFIC_LIGHT_PAD - px(1.),
|
||||
"the pad must clear the traffic lights (bare {bare_inset:?}, padded {padded_inset:?})"
|
||||
);
|
||||
}
|
||||
@@ -115,9 +111,7 @@ fn window_controls_render_only_when_the_flag_is_set() {
|
||||
let mut cx = TestAppContext::single();
|
||||
let (dock, mut visual) = dock_window(false, false, &mut cx);
|
||||
cx.update(|cx| {
|
||||
dock.update(cx, |dock, cx| {
|
||||
dock.register_panel(descriptor("overview"), cx)
|
||||
});
|
||||
dock.update(cx, |dock, _cx| dock.register_panel(descriptor("overview")));
|
||||
});
|
||||
open(&mut visual, &dock, "overview");
|
||||
|
||||
@@ -138,9 +132,7 @@ fn the_flag_hosts_the_platform_controls_in_the_bar() {
|
||||
let mut cx = TestAppContext::single();
|
||||
let (dock, mut visual) = dock_window(true, false, &mut cx);
|
||||
cx.update(|cx| {
|
||||
dock.update(cx, |dock, cx| {
|
||||
dock.register_panel(descriptor("overview"), cx)
|
||||
});
|
||||
dock.update(cx, |dock, _cx| dock.register_panel(descriptor("overview")));
|
||||
});
|
||||
open(&mut visual, &dock, "overview");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user