feat: keybinds for toggling displays
This commit is contained in:
parent
a689366324
commit
e310ca570b
4 changed files with 101 additions and 26 deletions
14
src/app/utils.rs
Normal file
14
src/app/utils.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use iced::widget;
|
||||
|
||||
use crate::app;
|
||||
|
||||
pub fn maybe_widget<'a>(
|
||||
condition: bool,
|
||||
widget: impl FnOnce() -> app::Element<'a>,
|
||||
) -> app::Element<'a> {
|
||||
if condition {
|
||||
widget()
|
||||
} else {
|
||||
widget::space().into()
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue