mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
use shared pointer for page id string
This commit is contained in:
parent
96d06c1ffb
commit
e41216ab75
3 changed files with 7 additions and 5 deletions
|
|
@ -17,7 +17,7 @@ use std::sync::Arc;
|
|||
pub struct Item {
|
||||
// Auto-generated unique item ID
|
||||
// useful as widget name in GTK actions callback
|
||||
id: GString,
|
||||
id: Arc<GString>,
|
||||
// Components
|
||||
page: Arc<Page>,
|
||||
widget: Arc<Widget>,
|
||||
|
|
@ -39,7 +39,7 @@ impl Item {
|
|||
is_selected: bool,
|
||||
) -> Arc<Self> {
|
||||
// Generate unique ID for new page components
|
||||
let id = uuid_string_random();
|
||||
let id = Arc::new(uuid_string_random());
|
||||
|
||||
// Init components
|
||||
let page = Page::new_arc(
|
||||
|
|
@ -201,7 +201,7 @@ impl Item {
|
|||
}
|
||||
|
||||
// Getters
|
||||
pub fn id(&self) -> GString {
|
||||
pub fn id(&self) -> Arc<GString> {
|
||||
self.id.clone()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue