From 7b4e869e098e4a0f5472722c65688fee067393e7 Mon Sep 17 00:00:00 2001 From: ItsEthra <107059409+ItsEthra@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:16:21 +0300 Subject: [PATCH] Updated to egui 0.23 && derived Default --- Cargo.toml | 6 +++--- LICENSE | 2 +- README.md | 2 +- src/toast.rs | 9 ++------- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d318dd1..3dd8365 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "egui-notify" -version = "0.9.0" +version = "0.10.0" edition = "2021" license = "MIT" repository = "https://github.com/ItsEthra/egui-notify" @@ -12,10 +12,10 @@ readme = "README.md" path = "src/lib.rs" [dependencies] -egui = { version = "0.22", default-features = false } +egui = { version = "0.23", default-features = false } [dev-dependencies] -eframe = { version = "0.22", default-features = false, features = [ +eframe = { version = "0.23", default-features = false, features = [ "default_fonts", "glow", ] } diff --git a/LICENSE b/LICENSE index ca3080a..fa00718 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 ItsEthra +Copyright (c) 2022-2023 ItsEthra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 45958e6..2662cee 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ toasts.show(ctx); # Installation ```toml [dependencies] -egui-notify = "0.8" +egui-notify = "0.10" ``` # Difference to [`egui-toast`](https://github.com/urholaukkarinen/egui-toast) diff --git a/src/toast.rs b/src/toast.rs index 13d7119..5935cb4 100644 --- a/src/toast.rs +++ b/src/toast.rs @@ -3,9 +3,10 @@ use egui::{pos2, vec2, FontId, Pos2, Rect}; use std::{fmt::Debug, time::Duration}; /// Level of importance -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Default, Clone, PartialEq, Eq)] #[allow(missing_docs)] pub enum ToastLevel { + #[default] Info, Warning, Error, @@ -14,12 +15,6 @@ pub enum ToastLevel { Custom(String, egui::Color32), } -impl Default for ToastLevel { - fn default() -> Self { - ToastLevel::Info - } -} - #[derive(Debug)] pub(crate) enum ToastState { Appear,