mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
[ui] add ui.heading(text) helper function
This commit is contained in:
@@ -456,6 +456,11 @@ impl Ui {
|
||||
self.add(label.into())
|
||||
}
|
||||
|
||||
/// Shortcut for `add(Label::new(text).heading())`
|
||||
pub fn heading(&mut self, label: impl Into<Label>) -> GuiResponse {
|
||||
self.add(label.into().heading())
|
||||
}
|
||||
|
||||
/// Shortcut for `add(Hyperlink::new(url))`
|
||||
pub fn hyperlink(&mut self, url: impl Into<String>) -> GuiResponse {
|
||||
self.add(Hyperlink::new(url))
|
||||
|
||||
@@ -67,6 +67,10 @@ impl Label {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn heading(self) -> Self {
|
||||
self.text_style(TextStyle::Heading)
|
||||
}
|
||||
|
||||
pub fn text_color(mut self, text_color: Color) -> Self {
|
||||
self.text_color = Some(text_color);
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user