Skip to content

Commit

Permalink
always show results
Browse files Browse the repository at this point in the history
  • Loading branch information
imsnif committed Mar 27, 2024
1 parent e0b5863 commit fb2daf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
9 changes: 1 addition & 8 deletions src/ui/controls_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ impl ControlsLine {
self.animation_offset = animation_offset;
self
}
pub fn render(&self, max_width: usize, show_controls: bool) -> String {
if show_controls {
self.render_controls(max_width)
} else {
self.render_empty_line(max_width)
}
}
pub fn render_controls(&self, max_width: usize) -> String {
pub fn render(&self, max_width: usize) -> String {
let loading_animation =
LoadingAnimation::new(&self.scanning_indication, self.animation_offset);
let full_length = loading_animation.full_len()
Expand Down
5 changes: 2 additions & 3 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ impl State {
}
}
pub fn render_controls_line(&self) -> String {
let has_results = !self.displayed_search_results.1.is_empty();
let tiled_floating_control =
Control::new_floating_control("Ctrl f", self.should_open_floating);
let names_contents_control = Control::new_filter_control("Ctrl r", &self.search_filter);
Expand All @@ -86,10 +85,10 @@ impl State {
Some(vec!["Scanning folder", "Scanning", "S"]),
)
.with_animation_offset(self.loading_animation_offset)
.render(self.display_columns, has_results)
.render(self.display_columns)
} else {
ControlsLine::new(controls, None)
.render(self.display_columns, has_results)
.render(self.display_columns)
}
}
}
Expand Down

0 comments on commit fb2daf5

Please sign in to comment.