1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Add Ui::hyperlink_to

This commit is contained in:
Emil Ernerfeldt
2021-02-20 09:23:38 +01:00
parent 9e38674d13
commit 21c99e1130
4 changed files with 16 additions and 8 deletions

View File

@@ -819,6 +819,16 @@ impl Ui {
self.add(Hyperlink::new(url))
}
/// Shortcut for `add(Hyperlink::new(url).text(label))`
///
/// ```
/// # let ui = &mut egui::Ui::__test();
/// ui.hyperlink_to("egui on GitHub", "https://www.github.com/emilk/egui/");
/// ```
pub fn hyperlink_to(&mut self, label: impl Into<String>, url: impl Into<String>) -> Response {
self.add(Hyperlink::new(url).text(label))
}
#[deprecated = "Use `text_edit_singleline` or `text_edit_multiline`"]
pub fn text_edit(&mut self, text: &mut String) -> Response {
self.text_edit_multiline(text)