From cb068befc28e82fc154f780104e6f88b75208de6 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Sat, 21 Sep 2024 16:10:27 +0200 Subject: [PATCH] fixing settings style page lifetimes --- src/gui/pages/overview_page.rs | 8 ++++---- src/gui/pages/settings_style_page.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/pages/overview_page.rs b/src/gui/pages/overview_page.rs index 0bc7ec97..90309bce 100644 --- a/src/gui/pages/overview_page.rs +++ b/src/gui/pages/overview_page.rs @@ -218,12 +218,12 @@ fn body_no_observed( .push(Space::with_height(FillPortion(2))) } -fn body_pcap_error( - pcap_error: &str, - waiting: &str, +fn body_pcap_error<'a>( + pcap_error: &'a str, + waiting: &'a str, language: Language, font: Font, -) -> Column<'static, Message, StyleType> { +) -> Column<'a, Message, StyleType> { // let err_string = pcap_error.clone().unwrap(); let error_text = error_translation(language, pcap_error) .align_x(Alignment::Center) diff --git a/src/gui/pages/settings_style_page.rs b/src/gui/pages/settings_style_page.rs index 014f375d..e7bb2764 100644 --- a/src/gui/pages/settings_style_page.rs +++ b/src/gui/pages/settings_style_page.rs @@ -29,7 +29,7 @@ use crate::utils::types::icon::Icon; use crate::StyleType::{Day, DeepSea, MonAmour, Night}; use crate::{ConfigSettings, Language, Sniffer, StyleType}; -pub fn settings_style_page<'a>(sniffer: &Sniffer) -> Container<'a, Message, StyleType> { +pub fn settings_style_page(sniffer: &Sniffer) -> Container { let ConfigSettings { style, language, @@ -119,11 +119,11 @@ pub fn settings_style_page<'a>(sniffer: &Sniffer) -> Container<'a, Message, Styl .class(ContainerType::Modal) } -fn gradients_row<'a>( +fn gradients_row( font: Font, color_gradient: GradientType, language: Language, -) -> Row<'a, Message, StyleType> { +) -> Row<'static, Message, StyleType> { Row::new() .align_y(Alignment::Center) .spacing(10) @@ -181,12 +181,12 @@ fn gradients_row<'a>( ) } -fn get_palette_container<'a>( +fn get_palette_container( style: StyleType, name: String, description: String, on_press: StyleType, -) -> Button<'a, Message, StyleType> { +) -> Button<'static, Message, StyleType> { let font = style.get_extension().font; let is_custom = matches!(on_press, StyleType::Custom(_)); @@ -218,11 +218,11 @@ fn get_palette_container<'a>( .on_press(Message::Style(on_press)) } -fn get_palette_rule<'a>( +fn get_palette_rule( palette: Palette, buttons_color: Color, is_custom: bool, -) -> Container<'a, Message, StyleType> { +) -> Container<'static, Message, StyleType> { let height = if is_custom { 25 } else { 40 }; Container::new(