From 5f32046ee9dc74f167912b09aaf2ec6b6aa53c1c Mon Sep 17 00:00:00 2001 From: pml68 Date: Mon, 26 May 2025 22:56:10 +0200 Subject: feat: switch from `String` to `Fragment` for `title` --- src/dialog.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dialog.rs b/src/dialog.rs index 550fa5a..74dea5a 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -6,7 +6,9 @@ use iced_core::{ }; use iced_widget::{ Column, Container, Row, Theme, center, container, mouse_area, opaque, - stack, text, vertical_space, + stack, text, + text::{Fragment, IntoFragment}, + vertical_space, }; /// A message dialog. @@ -26,7 +28,7 @@ pub struct Dialog< { is_open: bool, base: Element<'a, Message, Theme, Renderer>, - title: Option, + title: Option>, content: Element<'a, Message, Theme, Renderer>, buttons: Vec>, font: Option, @@ -81,8 +83,8 @@ where } /// Sets the [`Dialog`]'s title. - pub fn title(mut self, title: impl Into) -> Self { - self.title = Some(title.into()); + pub fn title(mut self, title: impl IntoFragment<'a>) -> Self { + self.title = Some(title.into_fragment()); self } -- cgit v1.2.3