Skip to content

Commit 6cfd972

Browse files
remove auto_shrink false
1 parent fa8bcd4 commit 6cfd972

File tree

2 files changed

+50
-54
lines changed

2 files changed

+50
-54
lines changed

crates/bevy_editor_pls_default_windows/src/hierarchy/mod.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,21 @@ impl EditorWindow for HierarchyWindow {
4141
}
4242
};
4343

44-
ScrollArea::vertical()
45-
.auto_shrink([false, false])
46-
.show(ui, |ui| {
47-
let type_registry = world.resource::<AppTypeRegistry>().clone();
48-
let type_registry = type_registry.read();
49-
let new_selected = Hierarchy {
50-
world,
51-
state: hierarchy_state,
52-
type_registry: &type_registry,
53-
add_state: add_state.as_deref(),
54-
}
55-
.show(ui);
44+
ScrollArea::vertical().show(ui, |ui| {
45+
let type_registry = world.resource::<AppTypeRegistry>().clone();
46+
let type_registry = type_registry.read();
47+
let new_selected = Hierarchy {
48+
world,
49+
state: hierarchy_state,
50+
type_registry: &type_registry,
51+
add_state: add_state.as_deref(),
52+
}
53+
.show(ui);
5654

57-
if new_selected {
58-
inspector_state.selected = InspectorSelection::Entities;
59-
}
60-
});
55+
if new_selected {
56+
inspector_state.selected = InspectorSelection::Entities;
57+
}
58+
});
6159
}
6260

6361
fn app_setup(app: &mut bevy::prelude::App) {

crates/bevy_editor_pls_default_windows/src/renderer.rs

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,42 @@ impl EditorWindow for RendererWindow {
1717
let type_registry = world.resource::<AppTypeRegistry>().clone();
1818
let type_registry = type_registry.read();
1919

20-
egui::ScrollArea::vertical()
21-
.auto_shrink([false, false])
22-
.show(ui, |ui| {
23-
let render_device = world.get_resource::<RenderDevice>().unwrap();
24-
25-
let limits = render_device.limits();
26-
let features = render_device.features();
27-
28-
ui.heading("Settings");
29-
egui::Grid::new("directional_light_shadow_map").show(ui, |ui| {
30-
let mut directional_light_shadow_map = world
31-
.get_resource_mut::<DirectionalLightShadowMap>()
32-
.unwrap();
33-
ui.label("Directional light shadow map size");
34-
let mut size = directional_light_shadow_map.size;
35-
36-
let mut context = Context::default();
37-
let mut env = InspectorUi::new_no_short_circuit(&type_registry, &mut context);
38-
if env.ui_for_reflect_with_options(
39-
&mut size,
40-
ui,
41-
egui::Id::NULL,
42-
&NumberOptions::at_least(1).with_speed(4.0),
43-
) {
44-
directional_light_shadow_map.size = size;
45-
}
46-
ui.end_row();
47-
});
48-
49-
ui.collapsing("Limits", |ui| {
50-
ui.label(RichText::new(format!("{:#?}", limits)).monospace());
51-
});
52-
ui.collapsing("Features", |ui| {
53-
let features = format!("{:#?}", features);
54-
for feature in features.split(" | ") {
55-
ui.label(RichText::new(format!("- {}", feature)).monospace());
56-
}
57-
});
20+
egui::ScrollArea::vertical().show(ui, |ui| {
21+
let render_device = world.get_resource::<RenderDevice>().unwrap();
22+
23+
let limits = render_device.limits();
24+
let features = render_device.features();
25+
26+
ui.heading("Settings");
27+
egui::Grid::new("directional_light_shadow_map").show(ui, |ui| {
28+
let mut directional_light_shadow_map = world
29+
.get_resource_mut::<DirectionalLightShadowMap>()
30+
.unwrap();
31+
ui.label("Directional light shadow map size");
32+
let mut size = directional_light_shadow_map.size;
33+
34+
let mut context = Context::default();
35+
let mut env = InspectorUi::new_no_short_circuit(&type_registry, &mut context);
36+
if env.ui_for_reflect_with_options(
37+
&mut size,
38+
ui,
39+
egui::Id::NULL,
40+
&NumberOptions::at_least(1).with_speed(4.0),
41+
) {
42+
directional_light_shadow_map.size = size;
43+
}
44+
ui.end_row();
5845
});
46+
47+
ui.collapsing("Limits", |ui| {
48+
ui.label(RichText::new(format!("{:#?}", limits)).monospace());
49+
});
50+
ui.collapsing("Features", |ui| {
51+
let features = format!("{:#?}", features);
52+
for feature in features.split(" | ") {
53+
ui.label(RichText::new(format!("- {}", feature)).monospace());
54+
}
55+
});
56+
});
5957
}
6058
}

0 commit comments

Comments
 (0)