Skip to content

Commit 9b557e4

Browse files
SquareManencounter
andauthored
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 <[email protected]>
1 parent b9ba579 commit 9b557e4

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

Diff for: objdiff-gui/src/app.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,7 @@ impl eframe::App for App {
775775

776776
if side_panel_available {
777777
egui::SidePanel::left("side_panel").show_animated(ctx, *show_side_panel, |ui| {
778-
egui::ScrollArea::both().show(ui, |ui| {
779-
config_ui(ui, state, show_project_config, config_state, appearance);
780-
});
778+
config_ui(ui, state, show_project_config, config_state, appearance);
781779
});
782780
}
783781

Diff for: objdiff-gui/src/views/config.rs

+30-26
Original file line numberDiff line numberDiff line change
@@ -297,27 +297,36 @@ pub fn config_ui(
297297
node_open = NodeOpen::Open;
298298
}
299299

300-
CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId {
301-
size: appearance.ui_font.size,
302-
family: appearance.code_font.family.clone(),
303-
}))
304-
.open(root_open)
305-
.default_open(true)
306-
.show(ui, |ui| {
307-
let search = config_state.object_search.to_ascii_lowercase();
308-
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
309-
for node in object_nodes.iter().filter_map(|node| {
310-
filter_node(
311-
objects,
312-
node,
313-
&search,
314-
config_state.filter_diffable,
315-
config_state.filter_incomplete,
316-
config_state.show_hidden,
317-
)
318-
}) {
319-
display_node(ui, &mut new_selected_index, objects, &node, appearance, node_open);
320-
}
300+
egui::ScrollArea::both().auto_shrink(false).show(ui, |ui| {
301+
CollapsingHeader::new(RichText::new("🗀 Objects").font(FontId {
302+
size: appearance.ui_font.size,
303+
family: appearance.code_font.family.clone(),
304+
}))
305+
.open(root_open)
306+
.default_open(true)
307+
.show(ui, |ui| {
308+
let search = config_state.object_search.to_ascii_lowercase();
309+
ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend);
310+
for node in object_nodes.iter().filter_map(|node| {
311+
filter_node(
312+
objects,
313+
node,
314+
&search,
315+
config_state.filter_diffable,
316+
config_state.filter_incomplete,
317+
config_state.show_hidden,
318+
)
319+
}) {
320+
display_node(
321+
ui,
322+
&mut new_selected_index,
323+
objects,
324+
&node,
325+
appearance,
326+
node_open,
327+
);
328+
}
329+
});
321330
});
322331
}
323332
if new_selected_index != selected_index {
@@ -327,11 +336,6 @@ pub fn config_ui(
327336
state_guard.set_selected_obj(config);
328337
}
329338
}
330-
if state_guard.config.selected_obj.is_some()
331-
&& ui.add_enabled(!config_state.build_running, egui::Button::new("Build")).clicked()
332-
{
333-
config_state.queue_build = true;
334-
}
335339
}
336340

337341
fn display_unit(

0 commit comments

Comments
 (0)