forked from ItsEthra/egui-notify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/aspectron/egui-notify
- Loading branch information
1 parent
1a7153f
commit da020bf
Showing
7 changed files
with
107 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,46 @@ | ||
# egui-notify | ||
|
||
Simple notifications library for [`egui`](https://github.com/emilk/egui) | ||
|
||
 | ||
|
||
 | ||
# Usage | ||
|
||
## Usage | ||
|
||
```rust | ||
use egui_notify::Toasts; | ||
use std::time::Duration; | ||
|
||
// initialize once | ||
let mut toasts = Toasts::default(); | ||
``` | ||
|
||
```rust | ||
// somewhere within [egui::App::update]... | ||
toasts.info("Hello world!").set_duration(Duration::from_secs(5)); | ||
// ... | ||
toasts.show(ctx); | ||
``` | ||
|
||
# Installation | ||
## Installation | ||
|
||
```sh | ||
cargo add egui-notify | ||
``` | ||
|
||
```toml | ||
[dependencies] | ||
egui-notify = "0.8" | ||
egui-notify = "0.15.0" | ||
``` | ||
|
||
# Difference to [`egui-toast`](https://github.com/urholaukkarinen/egui-toast) | ||
### `egui-notify` has | ||
- Animations for appearing/disappearing toasts | ||
- Duration meter for expiring toasts | ||
- Toast positioning not influenced by which `Context` you pass to it (like if for example, you passed in a `Context` already altered for an `egui::Window`) | ||
- Differing methodology (create `Toasts` instance once, save save somewhere in application state) | ||
- Threadsafe `Toasts` instance, implements `Send`, `Sync`. | ||
- No support for custom toasts | ||
## Difference to [`egui-toast`](https://github.com/urholaukkarinen/egui-toast) | ||
|
||
### `egui-notify` has | ||
|
||
- Animations for appearing/disappearing toasts | ||
- Duration meter for expiring toasts | ||
- Toast positioning not influenced by which `Context` you pass to it (like if for example, you passed in a `Context` already altered for an `egui::Window`) | ||
- Differing methodology (create `Toasts` instance once, save save somewhere in application state) | ||
- Threadsafe `Toasts` instance, implements `Send`, `Sync`. | ||
- No support for custom toasts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.