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

34
src/overlays/toast.rs Normal file
View File

@@ -0,0 +1,34 @@
use std::sync::Arc;
pub struct Toast {
pub title: Arc<str>,
pub body: Arc<str>,
pub opacity: f32,
pub timeout: f32,
pub sound: bool,
}
#[allow(dead_code)]
impl Toast {
pub fn new(title: Arc<str>, body: Arc<str>) -> Self {
Toast {
title,
body,
opacity: 1.0,
timeout: 3.0,
sound: false,
}
}
pub fn with_timeout(mut self, timeout: f32) -> Self {
self.timeout = timeout;
self
}
pub fn with_opacity(mut self, opacity: f32) -> Self {
self.opacity = opacity;
self
}
pub fn with_sound(mut self) -> Self {
self.sound = true;
self
}
}