/
githubmirror
/
lapce
Обзор
Документация
Войти
/
githubmirror
/
lapce
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lapce-app/src/web_link.rs
24 строки
639 B
Hanif Ariffin
Fix compilation with Rust 2024 Edition (#3637)
19 июн 2025, 10:52
Не верифицирован
19 июн 2025, 10:52
8d50fda
Код
Авторство
О чём код?
use floem::{ View, peniko::Color, style::CursorStyle, views::{Decorators, label}, }; use crate::{command::InternalCommand, listener::Listener}; pub fn web_link( text: impl Fn() -> String + 'static, uri: impl Fn() -> String + 'static, color: impl Fn() -> Color + 'static, internal_command: Listener<InternalCommand>, ) -> impl View { label(text) .on_click_stop(move |_| { internal_command.send(InternalCommand::OpenWebUri { uri: uri() }); }) .style(move |s| { s.color(color()) .hover(move |s| s.cursor(CursorStyle::Pointer)) }) }