diff options
| author | pml68 <contact@pml68.dev> | 2025-07-22 21:19:51 +0200 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-07-22 21:19:51 +0200 |
| commit | 84a8518ade52c49135ec8beb0f14025f7220e8d0 (patch) | |
| tree | 0522e6c01e1d127c121e9446994cd583b7488563 /src/widget/button.rs | |
| parent | style: better Cargo.toml formatting [skip ci] (diff) | |
| download | iced-builder-84a8518ade52c49135ec8beb0f14025f7220e8d0.tar.gz | |
feat: better button styling for "unsaved changes" dialog
Diffstat (limited to '')
| -rw-r--r-- | src/widget/button.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/widget/button.rs b/src/widget/button.rs new file mode 100644 index 0000000..5a1975b --- /dev/null +++ b/src/widget/button.rs @@ -0,0 +1,15 @@ +use iced::widget::button::{Status, Style}; +use iced_material::Theme; +use iced_material::button::styled; + +pub fn danger(theme: &Theme, status: Status) -> Style { + let primary = theme.colors().error; + + let foreground = primary.on_error; + let background = primary.color; + let disabled = theme.colors().surface.on_surface; + + let shadow_color = theme.colors().shadow; + + styled(background, foreground, disabled, shadow_color, 0, status) +} |
