mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +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>> (
|
pub fn wrap <'a, W: Widget<Engine = Tui>> (
|
||||||
self, parent_focus: bool, focus: Self, widget: &'a W
|
self, parent_focus: bool, focus: Self, widget: &'a W
|
||||||
) -> impl Widget<Engine = Tui> + 'a {
|
) -> impl Widget<Engine = Tui> + 'a {
|
||||||
Layers::new(move |add|{
|
let focused = parent_focus && focus == self;
|
||||||
if parent_focus && focus == self {
|
let corners = focused.then_some(CORNERS);
|
||||||
add(&CORNERS)?;
|
let highlight = focused.then_some(Background(Color::Rgb(60, 70, 50)));
|
||||||
add(&Background(Color::Rgb(60, 70, 50)))?;
|
lay!(corners, highlight, *widget)
|
||||||
}
|
|
||||||
add(widget)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue