fix title display

This commit is contained in:
yggverse 2025-01-22 20:04:07 +02:00
parent 771908a334
commit eae35d5ab8
2 changed files with 2 additions and 10 deletions

View File

@ -1,4 +1,4 @@
use gtk::{prelude::WidgetExt, Align, Label};
use gtk::{Align, Label};
pub struct Title {
pub label: Label,
@ -12,16 +12,9 @@ impl Title {
let label = Label::builder()
.css_classes(["heading"])
.halign(Align::Start)
.visible(false)
.label(title.unwrap_or("Input expected"))
.build();
if let Some(value) = title {
if !value.is_empty() {
label.set_label(value);
label.set_visible(true)
}
}
Self { label }
}
}

View File

@ -14,7 +14,6 @@ impl Title {
.css_classes(["heading"])
.halign(Align::Start)
.label(title.unwrap_or("Titan input"))
.visible(false)
.build(),
}
}