Skip to content

Limit left-panel scrollview to the file tree #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions objdiff-gui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,7 @@ impl eframe::App for App {

if side_panel_available {
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);
});
}

Expand Down
56 changes: 30 additions & 26 deletions objdiff-gui/src/views/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,27 +297,36 @@ pub fn config_ui(
node_open = NodeOpen::Open;
}

CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId {
size: appearance.ui_font.size,
family: appearance.code_font.family.clone(),
}))
.open(root_open)
.default_open(true)
.show(ui, |ui| {
let search = config_state.object_search.to_ascii_lowercase();
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
for node in object_nodes.iter().filter_map(|node| {
filter_node(
objects,
node,
&search,
config_state.filter_diffable,
config_state.filter_incomplete,
config_state.show_hidden,
)
}) {
display_node(ui, &mut new_selected_index, objects, &node, appearance, node_open);
}
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId {
size: appearance.ui_font.size,
family: appearance.code_font.family.clone(),
}))
.open(root_open)
.default_open(true)
.show(ui, |ui| {
let search = config_state.object_search.to_ascii_lowercase();
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
for node in object_nodes.iter().filter_map(|node| {
filter_node(
objects,
node,
&search,
config_state.filter_diffable,
config_state.filter_incomplete,
config_state.show_hidden,
)
}) {
display_node(
ui,
&mut new_selected_index,
objects,
&node,
appearance,
node_open,
);
}
});
});
}
if new_selected_index != selected_index {
Expand All @@ -327,11 +336,6 @@ pub fn config_ui(
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(
Expand Down
Loading