mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
use is_pinned mutex as the struct option, begin use arc for new structs by default
This commit is contained in:
parent
41f0452e26
commit
793d179164
6 changed files with 37 additions and 29 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gtk::{
|
||||
glib::GString, prelude::BoxExt, prelude::WidgetExt, Align, Box, Image, Label, Orientation,
|
||||
};
|
||||
|
|
@ -8,7 +10,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new(name: GString, pin: &Image, title: &Label) -> Self {
|
||||
pub fn new(name: GString, pin: &Image, title: &Label) -> Arc<Self> {
|
||||
let gobject = Box::builder()
|
||||
.orientation(Orientation::Horizontal)
|
||||
.halign(Align::Center)
|
||||
|
|
@ -19,7 +21,7 @@ impl Widget {
|
|||
gobject.append(pin);
|
||||
gobject.append(title);
|
||||
|
||||
Self { gobject }
|
||||
Arc::new(Self { gobject })
|
||||
}
|
||||
|
||||
// Action
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue