-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toast widget #517
feat: toast widget #517
Conversation
Should this be moved to core ? |
src/widget/toaster/mod.rs
Outdated
tokio::time::sleep(duration).await; | ||
}, | ||
|_| crate::app::Message::App(message.into()), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crate::command::future(async move {
tokio::time::sleep(duration).await;
Message::from(message)
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to write
crate::command::future(async move {
tokio::time::sleep(duration).await;
crate::app::Message::App(Message::from(message))
})
So, should this be moved to core, like the navbar? @mmstick |
Probably |
With the current impl, it requires Core to be generic over Message, is it ok? |
That kind of state should be in the app struct |
The only idea i have is adding this function in the Application trait Can you think of a better solution ? Maybe it will be preferable to not include in core afterall |
I think it's fine for the app to store the model of the toaster. Similar to what it already does for other widgets. |
Thanks! |
Attempt to implement pop-os/cosmic-files#183
I implemented this feature in fan-control. You can see the change i needed to make in this commit.
The duration chosen comes from Android.
There is more just to match the Ui design, but the idea is there. I'm not sure i will implement it as i don't really know where to search for padding, colours, ect..