pub struct Hyperlink {
url: String,
text: WidgetText,
new_tab: bool,
}
Expand description
A clickable hyperlink, e.g. to "https://github.com/emilk/egui"
.
See also Ui::hyperlink
and Ui::hyperlink_to
.
// These are equivalent:
ui.hyperlink("https://github.com/emilk/egui");
ui.add(egui::Hyperlink::new("https://github.com/emilk/egui"));
// These are equivalent:
ui.hyperlink_to("My favorite repo", "https://github.com/emilk/egui");
ui.add(egui::Hyperlink::from_label_and_url("My favorite repo", "https://github.com/emilk/egui"));
Fields§
§url: String
§text: WidgetText
§new_tab: bool
Implementations§
source§impl Hyperlink
impl Hyperlink
pub fn new(url: impl ToString) -> Self
pub fn from_label_and_url( text: impl Into<WidgetText>, url: impl ToString, ) -> Self
sourcepub fn open_in_new_tab(self, new_tab: bool) -> Self
pub fn open_in_new_tab(self, new_tab: bool) -> Self
Always open this hyperlink in a new browser tab.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hyperlink
impl RefUnwindSafe for Hyperlink
impl Send for Hyperlink
impl Sync for Hyperlink
impl Unpin for Hyperlink
impl UnwindSafe for Hyperlink
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more