mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-04 23:44:13 +00:00
fix title display
This commit is contained in:
parent
771908a334
commit
eae35d5ab8
@ -1,4 +1,4 @@
|
|||||||
use gtk::{prelude::WidgetExt, Align, Label};
|
use gtk::{Align, Label};
|
||||||
|
|
||||||
pub struct Title {
|
pub struct Title {
|
||||||
pub label: Label,
|
pub label: Label,
|
||||||
@ -12,16 +12,9 @@ impl Title {
|
|||||||
let label = Label::builder()
|
let label = Label::builder()
|
||||||
.css_classes(["heading"])
|
.css_classes(["heading"])
|
||||||
.halign(Align::Start)
|
.halign(Align::Start)
|
||||||
.visible(false)
|
.label(title.unwrap_or("Input expected"))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
if let Some(value) = title {
|
|
||||||
if !value.is_empty() {
|
|
||||||
label.set_label(value);
|
|
||||||
label.set_visible(true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Self { label }
|
Self { label }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ impl Title {
|
|||||||
.css_classes(["heading"])
|
.css_classes(["heading"])
|
||||||
.halign(Align::Start)
|
.halign(Align::Start)
|
||||||
.label(title.unwrap_or("Titan input"))
|
.label(title.unwrap_or("Titan input"))
|
||||||
.visible(false)
|
|
||||||
.build(),
|
.build(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user