Limit left-panel scrollview to the file tree (#185)

* Limit left-panel scrollview to the file tree

Removes the redundant build button

* Expand ScrollArea to full side panel width

* Use auto_shrink(false) instead of set_width

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
Steven Casper 2025-04-01 14:35:17 -04:00 committed by GitHub
parent b9ba5796ed
commit 9b557e4c8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 29 deletions

View File

@ -775,10 +775,8 @@ impl eframe::App for App {
if side_panel_available { if side_panel_available {
egui::SidePanel::left("side_panel").show_animated(ctx, *show_side_panel, |ui| { egui::SidePanel::left("side_panel").show_animated(ctx, *show_side_panel, |ui| {
egui::ScrollArea::both().show(ui, |ui| {
config_ui(ui, state, show_project_config, config_state, appearance); config_ui(ui, state, show_project_config, config_state, appearance);
}); });
});
} }
let mut action = None; let mut action = None;

View File

@ -297,6 +297,7 @@ pub fn config_ui(
node_open = NodeOpen::Open; node_open = NodeOpen::Open;
} }
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId { CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId {
size: appearance.ui_font.size, size: appearance.ui_font.size,
family: appearance.code_font.family.clone(), family: appearance.code_font.family.clone(),
@ -316,9 +317,17 @@ pub fn config_ui(
config_state.show_hidden, config_state.show_hidden,
) )
}) { }) {
display_node(ui, &mut new_selected_index, objects, &node, appearance, node_open); display_node(
ui,
&mut new_selected_index,
objects,
&node,
appearance,
node_open,
);
} }
}); });
});
} }
if new_selected_index != selected_index { if new_selected_index != selected_index {
if let Some(idx) = new_selected_index { if let Some(idx) = new_selected_index {
@ -327,11 +336,6 @@ pub fn config_ui(
state_guard.set_selected_obj(config); state_guard.set_selected_obj(config);
} }
} }
if state_guard.config.selected_obj.is_some()
&& ui.add_enabled(!config_state.build_running, egui::Button::new("Build")).clicked()
{
config_state.queue_build = true;
}
} }
fn display_unit( fn display_unit(