diff --git a/egui/src/widgets/hyperlink.rs b/egui/src/widgets/hyperlink.rs index 88f517d2..20807ef6 100644 --- a/egui/src/widgets/hyperlink.rs +++ b/egui/src/widgets/hyperlink.rs @@ -3,31 +3,35 @@ use crate::*; /// A clickable hyperlink, e.g. to `"https://github.com/emilk/egui"`. #[must_use = "You should put this widget in an ui with `ui.add(widget);`"] pub struct Hyperlink { - // TODO: wrap Label url: String, - text: String, - pub(crate) text_style: Option, + label: Label, } impl Hyperlink { pub fn new(url: impl Into) -> Self { let url = url.into(); Self { - text: url.clone(), - url, - text_style: None, + url: url.clone(), + label: Label::new(url), + } + } + + pub fn from_label_and_url(label: impl Into