From aa0a026855b850c7b89670995795f5e95b99e9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Wed, 23 Oct 2024 00:16:30 +0200 Subject: [PATCH] fix(context menu): use radius from theme --- src/menu.rs | 6 +++--- src/tab.rs | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/menu.rs b/src/menu.rs index a8e9b66..d1654fb 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -295,14 +295,14 @@ pub fn context_menu<'a>( text_color: Some(component.on.into()), background: Some(Background::Color(component.base.into())), border: Border { - radius: 8.0.into(), + radius: cosmic.radius_s().into(), width: 1.0, color: component.divider.into(), }, ..Default::default() } }) - .width(Length::Fixed(260.0)) + .width(Length::Fixed(280.0)) .into() } @@ -645,7 +645,7 @@ pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Mess text_color: Some(component.on.into()), background: Some(Background::Color(component.base.into())), border: Border { - radius: 8.0.into(), + radius: cosmic.radius_s().into(), width: 1.0, color: component.divider.into(), }, diff --git a/src/tab.rs b/src/tab.rs index b59e483..89ec02b 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -3020,10 +3020,7 @@ impl Tab { //TODO: use widget::image::viewer, when its zoom can be reset widget::image(widget::image::Handle::from_path(path)), ) - .align_x(Alignment::Center) - .align_y(Alignment::Center) - .width(Length::Fill) - .height(Length::Fill) + .center(Length::Fill) .into(), ); } else { @@ -3032,10 +3029,7 @@ impl Tab { //TODO: use widget::image::viewer, when its zoom can be reset widget::image(handle.clone()), ) - .align_x(Alignment::Center) - .align_y(Alignment::Center) - .width(Length::Fill) - .height(Length::Fill) + .center(Length::Fill) .into(), ); }