[MIRROR] https://codeberg.org/naomi/nanel

Remove `'static`s

+34 -34
+29 -29
src/modules.rs
··· 45 }, 46 } 47 48 - pub fn get_connection<Message>(show_connection: &bool) -> Option<Element<'static, Message>> { 49 match show_connection { 50 true => Some(small_icon(Bootstrap::Wifi).into()), 51 false => None, 52 } 53 } 54 55 - pub fn get_volume<Message>(show_volume: &bool) -> Option<Element<'static, Message>> { 56 match show_volume { 57 true => Some(small_icon(Bootstrap::VolumeUpFill).into()), 58 false => None, 59 } 60 } 61 62 - pub fn get_power<Message>(show_power: &bool) -> Option<Element<'static, Message>> { 63 match show_power { 64 true => Some(small_icon(Bootstrap::Battery).into()), 65 false => None, 66 } 67 } 68 - pub fn start_menu<Message>( 69 on_press: fn(ButtonInfo) -> Message, 70 vertical: &bool, 71 - ) -> Element<'static, Message> 72 where 73 - Message: Clone + 'static, 74 { 75 taskbar_button_with_info( 76 icon(Bootstrap::Microsoft), ··· 82 .into() 83 } 84 85 - pub fn workspaces<Message>(message: Message, vertical: &bool) -> Element<'static, Message> 86 where 87 - Message: Clone + 'static, 88 { 89 taskbar_button( 90 icon(Bootstrap::Stack), ··· 96 .into() 97 } 98 99 - pub fn directory_menu<Message>( 100 on_press: fn(ButtonInfo) -> Message, 101 vertical: &bool, 102 - ) -> Element<'static, Message> 103 where 104 - Message: Clone + 'static, 105 { 106 taskbar_button_with_info( 107 icon(Bootstrap::FolderFill), ··· 113 .into() 114 } 115 116 - pub fn system_tray<Message>( 117 on_press: fn(ButtonInfo) -> Message, 118 hidden_menu: &bool, 119 vertical: &bool, 120 position: config::Position, 121 - ) -> Element<'static, Message> 122 where 123 - Message: Clone + 'static, 124 { 125 let icon = match position { 126 config::Position::Top => small_icon(Bootstrap::ChevronDown), ··· 143 } 144 } 145 146 - pub fn notification_tray<Message>( 147 on_press: fn(ButtonInfo) -> Message, 148 vertical: &bool, 149 - ) -> Element<'static, Message> 150 where 151 - Message: Clone + 'static, 152 { 153 taskbar_button_with_info( 154 small_icon(Bootstrap::Bell), ··· 160 .into() 161 } 162 163 - pub fn quick_settings<Message>( 164 on_press: fn(ButtonInfo) -> Message, 165 - connection: Option<Element<'static, Message>>, 166 - volume: Option<Element<'static, Message>>, 167 - power: Option<Element<'static, Message>>, 168 vertical: &bool, 169 - ) -> Element<'static, Message> 170 where 171 - Message: Clone + 'static, 172 { 173 taskbar_button_with_info( 174 match vertical { ··· 256 (date, time) 257 } 258 259 - pub fn date_time<Message>( 260 on_press: fn(ButtonInfo) -> Message, 261 datetime: DateTime<Local>, 262 mm_dd_yyyy: &bool, 263 military: &bool, 264 seconds: &bool, 265 vertical: &bool, 266 - ) -> Element<'static, Message> 267 where 268 - Message: Clone + 'static, 269 { 270 let (date, time) = get_time(datetime, mm_dd_yyyy, military, seconds); 271 ··· 289 .into() 290 } 291 292 - pub fn view_desktop<Message>( 293 message: Message, 294 thin: &bool, 295 vertical: &bool, 296 - ) -> Element<'static, Message> 297 where 298 - Message: Clone + 'static, 299 { 300 match thin { 301 true => taskbar_button_thin(
··· 45 }, 46 } 47 48 + pub fn get_connection<'a, Message>(show_connection: &bool) -> Option<Element<'a, Message>> { 49 match show_connection { 50 true => Some(small_icon(Bootstrap::Wifi).into()), 51 false => None, 52 } 53 } 54 55 + pub fn get_volume<'a, Message>(show_volume: &bool) -> Option<Element<'a, Message>> { 56 match show_volume { 57 true => Some(small_icon(Bootstrap::VolumeUpFill).into()), 58 false => None, 59 } 60 } 61 62 + pub fn get_power<'a, Message>(show_power: &bool) -> Option<Element<'a, Message>> { 63 match show_power { 64 true => Some(small_icon(Bootstrap::Battery).into()), 65 false => None, 66 } 67 } 68 + pub fn start_menu<'a, Message>( 69 on_press: fn(ButtonInfo) -> Message, 70 vertical: &bool, 71 + ) -> Element<'a, Message> 72 where 73 + Message: Clone + 'a, 74 { 75 taskbar_button_with_info( 76 icon(Bootstrap::Microsoft), ··· 82 .into() 83 } 84 85 + pub fn workspaces<'a, Message>(message: Message, vertical: &bool) -> Element<'a, Message> 86 where 87 + Message: Clone + 'a, 88 { 89 taskbar_button( 90 icon(Bootstrap::Stack), ··· 96 .into() 97 } 98 99 + pub fn directory_menu<'a, Message>( 100 on_press: fn(ButtonInfo) -> Message, 101 vertical: &bool, 102 + ) -> Element<'a, Message> 103 where 104 + Message: Clone + 'a, 105 { 106 taskbar_button_with_info( 107 icon(Bootstrap::FolderFill), ··· 113 .into() 114 } 115 116 + pub fn system_tray<'a, Message>( 117 on_press: fn(ButtonInfo) -> Message, 118 hidden_menu: &bool, 119 vertical: &bool, 120 position: config::Position, 121 + ) -> Element<'a, Message> 122 where 123 + Message: Clone + 'a, 124 { 125 let icon = match position { 126 config::Position::Top => small_icon(Bootstrap::ChevronDown), ··· 143 } 144 } 145 146 + pub fn notification_tray<'a, Message>( 147 on_press: fn(ButtonInfo) -> Message, 148 vertical: &bool, 149 + ) -> Element<'a, Message> 150 where 151 + Message: Clone + 'a, 152 { 153 taskbar_button_with_info( 154 small_icon(Bootstrap::Bell), ··· 160 .into() 161 } 162 163 + pub fn quick_settings<'a, Message>( 164 on_press: fn(ButtonInfo) -> Message, 165 + connection: Option<Element<'a, Message>>, 166 + volume: Option<Element<'a, Message>>, 167 + power: Option<Element<'a, Message>>, 168 vertical: &bool, 169 + ) -> Element<'a, Message> 170 where 171 + Message: Clone + 'a, 172 { 173 taskbar_button_with_info( 174 match vertical { ··· 256 (date, time) 257 } 258 259 + pub fn date_time<'a, Message>( 260 on_press: fn(ButtonInfo) -> Message, 261 datetime: DateTime<Local>, 262 mm_dd_yyyy: &bool, 263 military: &bool, 264 seconds: &bool, 265 vertical: &bool, 266 + ) -> Element<'a, Message> 267 where 268 + Message: Clone + 'a, 269 { 270 let (date, time) = get_time(datetime, mm_dd_yyyy, military, seconds); 271 ··· 289 .into() 290 } 291 292 + pub fn view_desktop<'a, Message>( 293 message: Message, 294 thin: &bool, 295 vertical: &bool, 296 + ) -> Element<'a, Message> 297 where 298 + Message: Clone + 'a, 299 { 300 match thin { 301 true => taskbar_button_thin(
+3 -3
src/panel.rs
··· 68 UserClosedWindow(iced::window::Id), 69 } 70 71 - pub fn label(string: &str) -> Text<'static> { 72 text(String::from(string)) 73 .font(Font::with_name("Selawik")) 74 .align_x(Alignment::Center) ··· 136 time::every(time::Duration::from_millis(200)).map(|_x| Message::PanelUpdatedTime) 137 } 138 139 - pub fn get_widget(&self, module: &Module) -> Element<Message> 140 where 141 - Message: Clone + 'static, 142 { 143 match module { 144 Module::StartMenu => start_menu(
··· 68 UserClosedWindow(iced::window::Id), 69 } 70 71 + pub fn label<'a>(string: &str) -> Text<'a> { 72 text(String::from(string)) 73 .font(Font::with_name("Selawik")) 74 .align_x(Alignment::Center) ··· 136 time::every(time::Duration::from_millis(200)).map(|_x| Message::PanelUpdatedTime) 137 } 138 139 + pub fn get_widget<'a>(&self, module: &Module) -> Element<Message> 140 where 141 + Message: Clone + 'a, 142 { 143 match module { 144 Module::StartMenu => start_menu(
+2 -2
src/widgets.rs
··· 98 } 99 } 100 101 - pub fn icon(icon: iced_fonts::Bootstrap) -> Text<'static> { 102 to_text(icon) 103 .size(24) 104 .align_x(Alignment::Center) 105 .align_y(Alignment::Center) 106 } 107 108 - pub fn small_icon(icon: iced_fonts::Bootstrap) -> Text<'static> { 109 to_text(icon) 110 .size(18) 111 .align_x(Alignment::Center)
··· 98 } 99 } 100 101 + pub fn icon<'a>(icon: iced_fonts::Bootstrap) -> Text<'a> { 102 to_text(icon) 103 .size(24) 104 .align_x(Alignment::Center) 105 .align_y(Alignment::Center) 106 } 107 108 + pub fn small_icon<'a>(icon: iced_fonts::Bootstrap) -> Text<'a> { 109 to_text(icon) 110 .size(18) 111 .align_x(Alignment::Center)