mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
save 3 lines in TransportToolbarFocus::wrap
This commit is contained in:
parent
0e6ad98fa5
commit
1adee9ab13
1 changed files with 4 additions and 7 deletions
|
|
@ -110,12 +110,9 @@ impl TransportToolbarFocus {
|
|||
pub fn wrap <'a, W: Widget<Engine = Tui>> (
|
||||
self, parent_focus: bool, focus: Self, widget: &'a W
|
||||
) -> impl Widget<Engine = Tui> + 'a {
|
||||
Layers::new(move |add|{
|
||||
if parent_focus && focus == self {
|
||||
add(&CORNERS)?;
|
||||
add(&Background(Color::Rgb(60, 70, 50)))?;
|
||||
}
|
||||
add(widget)
|
||||
})
|
||||
let focused = parent_focus && focus == self;
|
||||
let corners = focused.then_some(CORNERS);
|
||||
let highlight = focused.then_some(Background(Color::Rgb(60, 70, 50)));
|
||||
lay!(corners, highlight, *widget)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue