some nice changes

This commit is contained in:
2024-11-07 23:58:29 +01:00
parent 739a5ea72a
commit 5ff2866f26
7 changed files with 158 additions and 77 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ pub use elements::*;
/// # Returns
///
/// A `Box<Text>` containing a new `Text` element instance.
pub fn text() -> Box<Text> {
pub fn text<'a>() -> Box<Text<'a>> {
Box::new(Text::new())
}
@@ -26,7 +26,7 @@ pub fn text() -> Box<Text> {
/// # Returns
///
/// A `Box<Button>` containing a new `Button` element instance.
pub fn button() -> Box<Button> {
pub fn button<'a>() -> Box<Button<'a>> {
let mut btn = Button::new();
btn.style.clicked_bg = styles::Color::White;
btn.style.clicked_fg = styles::Color::Black;
@@ -41,6 +41,6 @@ pub fn button() -> Box<Button> {
/// # Returns
///
/// A `Box<Div>` containing a new `Div` element instance.
pub fn div() -> Box<Div> {
pub fn div<'a>() -> Box<Div<'a>> {
Box::new(Div::new())
}