mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-11 02:44:15 +00:00
rename widget entity
This commit is contained in:
parent
2a1e788f8d
commit
91ad71033a
@ -18,7 +18,7 @@ impl Main {
|
|||||||
let tab = tab::Tab::new();
|
let tab = tab::Tab::new();
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
let widget = widget::Main::new(tab.widget().tab());
|
let widget = widget::Main::new(tab.widget().notebook());
|
||||||
|
|
||||||
// Init struct
|
// Init struct
|
||||||
Arc::new(Self { tab, widget })
|
Arc::new(Self { tab, widget })
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
pub struct Tab {
|
pub struct Tab {
|
||||||
tab: gtk::Notebook,
|
notebook: gtk::Notebook,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Tab {
|
impl Tab {
|
||||||
// Construct new object
|
// Construct new object
|
||||||
pub fn new() -> Tab {
|
pub fn new() -> Tab {
|
||||||
Self {
|
Self {
|
||||||
tab: gtk::Notebook::builder().scrollable(true).build(),
|
notebook: gtk::Notebook::builder().scrollable(true).build(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn append(&self, label: >k::Box, page: >k::Box, current: bool) -> u32 {
|
pub fn append(&self, label: >k::Box, page: >k::Box, current: bool) -> u32 {
|
||||||
let page_number = self.tab.append_page(page, Some(label));
|
let page_number = self.notebook.append_page(page, Some(label));
|
||||||
|
|
||||||
self.tab.set_tab_reorderable(page, true);
|
self.notebook.set_tab_reorderable(page, true);
|
||||||
|
|
||||||
if current {
|
if current {
|
||||||
self.tab.set_current_page(Some(page_number));
|
self.notebook.set_current_page(Some(page_number));
|
||||||
}
|
}
|
||||||
|
|
||||||
page_number
|
page_number
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
pub fn tab(&self) -> >k::Notebook {
|
pub fn notebook(&self) -> >k::Notebook {
|
||||||
&self.tab
|
&self.notebook
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user