From d9a5dd91f49ff83010be7882b0df477da0d2d446 Mon Sep 17 00:00:00 2001 From: Exidex <16986685+Exidex@users.noreply.github.com> Date: Thu, 30 May 2024 22:05:34 +0200 Subject: [PATCH] Refine Empty View --- rust/client/src/ui/widget.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rust/client/src/ui/widget.rs b/rust/client/src/ui/widget.rs index b586231..e5b12d9 100644 --- a/rust/client/src/ui/widget.rs +++ b/rust/client/src/ui/widget.rs @@ -857,22 +857,37 @@ impl ComponentWidgetWrapper { } ComponentWidget::EmptyView { title, description, image } => { let image: Option> = image.as_ref() - .map(|image| iced::widget::image(Handle::from_memory(image.data.clone())).into()); // FIXME really expensive clone + .map(|image| { + iced::widget::image(Handle::from_memory(image.data.clone())) // FIXME really expensive clone + .width(100) + .height(100) + .into() + }); let title: Element<_> = text(title) .into(); let subtitle: Element<_> = match description { None => horizontal_space().into(), - Some(subtitle) => text(subtitle).into(), + Some(subtitle) => { + text(subtitle) + .style(TextStyle::Subtext) + .into() + } }; let mut content = vec![title, subtitle]; if let Some(image) = image { + + let image: Element<_> = container(image) + .padding(Padding::new(10.0)) + .into(); + content.insert(0, image) } let content: Element<_> = column(content) + .align_items(Alignment::Center) .into(); container(content)