rework interactions

This commit is contained in:
galister
2024-02-04 14:23:28 +01:00
parent e846014a88
commit 82f53e6668
15 changed files with 201 additions and 102 deletions

View File

@@ -11,6 +11,7 @@ use crate::{
overlays::{
keyboard::create_keyboard,
screen::{get_screens_wayland, get_screens_x11},
toast::Toast,
watch::create_watch,
},
state::AppState,
@@ -106,7 +107,7 @@ where
self.overlays.values_mut().for_each(|o| {
if o.state.show_hide {
o.state.want_visible = !any_shown;
if o.state.want_visible && app.session.recenter_on_show {
if o.state.want_visible && o.state.recenter {
o.state.reset(app, false);
}
}
@@ -114,6 +115,7 @@ where
}
}
#[derive(Clone)]
pub enum OverlaySelector {
Id(usize),
Name(Arc<str>),
@@ -147,6 +149,7 @@ pub enum TaskType {
OverlaySelector,
Box<dyn FnOnce(&mut AppState, &mut OverlayState) + Send>,
),
Toast(Toast),
}
pub struct TaskContainer {