Skip to content

Commit

Permalink
refactor: map_or_else to map_or
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Oct 7, 2022
1 parent 5c9f253 commit 3e26f29
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/ui/draw_blocks.rs
Expand Up @@ -51,10 +51,7 @@ fn generate_block<'a>(
panel: SelectablePanel,
) -> Block<'a> {
gui_state.lock().update_map(Region::Panel(panel), area);
let mut block = Block::default()
.borders(Borders::ALL)
.border_type(BorderType::Rounded);
let current_selected_panel = gui_state.lock().selected_panel;
let current_selected_panel = gui_state.lock().selected_panel;
let title = match panel {
SelectablePanel::Containers => {
format!(
Expand All @@ -68,7 +65,10 @@ fn generate_block<'a>(
}
SelectablePanel::Commands => String::from(""),
};
block = block.title(title);
let mut block = Block::default()
.borders(Borders::ALL)
.border_type(BorderType::Rounded)
.title(title);
if current_selected_panel == panel {
block = block.border_style(Style::default().fg(Color::LightCyan));
}
Expand Down Expand Up @@ -109,9 +109,7 @@ pub fn commands<B: Backend>(
&mut app_data.lock().containers.items[i].docker_controls.state,
);
} else {
let paragraph = Paragraph::new("")
.block(block)
.alignment(Alignment::Center);
let paragraph = Paragraph::new("").block(block).alignment(Alignment::Center);
f.render_widget(paragraph, area);
}
}
Expand Down

0 comments on commit 3e26f29

Please sign in to comment.