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