mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
generate unique HashMap keys for children widgets
This commit is contained in:
parent
0d89e16622
commit
f407117470
3 changed files with 46 additions and 30 deletions
|
|
@ -1,11 +1,15 @@
|
|||
mod pin;
|
||||
mod title;
|
||||
|
||||
use gtk::prelude::{BoxExt, WidgetExt};
|
||||
use gtk::{Align, Box, Orientation};
|
||||
use pin::Pin;
|
||||
use title::Title;
|
||||
|
||||
use gtk::{
|
||||
glib::GString,
|
||||
prelude::{BoxExt, WidgetExt},
|
||||
Align, Box, Orientation,
|
||||
};
|
||||
|
||||
pub struct Label {
|
||||
// Components
|
||||
pin: Pin,
|
||||
|
|
@ -17,7 +21,7 @@ pub struct Label {
|
|||
|
||||
impl Label {
|
||||
// Construct
|
||||
pub fn new(is_pinned: bool) -> Label {
|
||||
pub fn new(name: GString, is_pinned: bool) -> Label {
|
||||
// Components
|
||||
let pin = Pin::new(is_pinned);
|
||||
let title = Title::new();
|
||||
|
|
@ -26,6 +30,7 @@ impl Label {
|
|||
let widget = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
.halign(Align::Center)
|
||||
.name(name)
|
||||
.build();
|
||||
|
||||
widget.append(pin.widget());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue