rename struct entity

This commit is contained in:
yggverse 2024-09-23 14:57:02 +03:00
parent 7e7ad470e1
commit b162682f51
3 changed files with 12 additions and 12 deletions

View File

@ -11,8 +11,8 @@ impl Label {
pub fn new() -> Label {
Self {
widget: widget::Label::new(
pin::Pin::new().widget().gtk(),
title::Title::new().widget().gtk(),
pin::Pin::new().widget().image(),
title::Title::new().widget().label(),
),
}
}

View File

@ -1,20 +1,20 @@
pub struct Pin {
gtk: gtk::Image,
image: gtk::Image,
}
impl Pin {
// Construct
pub fn new() -> Pin {
let gtk = gtk::Image::builder()
let image = gtk::Image::builder()
.icon_name("view-pin-symbolic")
.visible(false) //@TODO
.build();
Self { gtk }
Self { image }
}
// Getters
pub fn gtk(&self) -> &gtk::Image {
&self.gtk
pub fn image(&self) -> &gtk::Image {
&self.image
}
}

View File

@ -1,22 +1,22 @@
pub struct Title {
gtk: gtk::Label,
label: gtk::Label,
}
impl Title {
// Construct
pub fn new() -> Title {
let gtk = gtk::Label::builder()
let label = gtk::Label::builder()
.label("New page")
.ellipsize(gtk::pango::EllipsizeMode::End)
.width_chars(16)
.single_line_mode(true)
.build();
Self { gtk }
Self { label }
}
// Getters
pub fn gtk(&self) -> &gtk::Label {
&self.gtk
pub fn label(&self) -> &gtk::Label {
&self.label
}
}