summaryrefslogtreecommitdiff
path: root/src/dialog.rs
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-07-22 21:19:51 +0200
committerpml68 <contact@pml68.dev>2025-07-22 21:19:51 +0200
commit84a8518ade52c49135ec8beb0f14025f7220e8d0 (patch)
tree0522e6c01e1d127c121e9446994cd583b7488563 /src/dialog.rs
parentstyle: better Cargo.toml formatting [skip ci] (diff)
downloadiced-builder-84a8518ade52c49135ec8beb0f14025f7220e8d0.tar.gz
feat: better button styling for "unsaved changes" dialog
Diffstat (limited to 'src/dialog.rs')
-rw-r--r--src/dialog.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dialog.rs b/src/dialog.rs
index 3a79dd4..c5e008c 100644
--- a/src/dialog.rs
+++ b/src/dialog.rs
@@ -1,10 +1,12 @@
use std::borrow::Cow;
-use iced::widget::text;
+use iced::widget::{Space, text};
use iced_dialog::button;
+use iced_material::button::filled_tonal;
use crate::Message;
use crate::types::Element;
+use crate::widget::button::danger;
pub const UNSAVED_CHANGES_TITLE: &str = "Hold on for a sec!";
pub const WARNING_TITLE: &str = "Heads up!";
@@ -31,8 +33,11 @@ impl From<Action> for Vec<Element<'_, Message>> {
Action::None => vec![],
Action::Close => vec![button("Close", Message::DialogYes).into()],
Action::UnsavedChanges(_) => vec![
- button("Don't Save", Message::DialogNo).into(),
- button("Save", Message::DialogYes).into(),
+ button("Don't Save", Message::DialogNo).style(danger).into(),
+ Space::with_width(20).into(),
+ button("Save", Message::DialogYes)
+ .style(filled_tonal)
+ .into(),
button("Cancel", Message::DialogCancel).into(),
],
}