2024-09-18 22:38:18 +03:00
|
|
|
#[path = "tab/label.rs"] mod label;
|
|
|
|
#[path = "tab/page.rs"] mod page;
|
|
|
|
|
2024-09-18 22:07:52 +03:00
|
|
|
use gtk::Notebook;
|
|
|
|
|
|
|
|
pub fn new() -> Notebook
|
|
|
|
{
|
2024-09-18 22:16:58 +03:00
|
|
|
return Notebook::builder().scrollable(true).build();
|
2024-09-18 22:38:18 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn append(
|
|
|
|
tab : Notebook,
|
|
|
|
is_current : bool
|
|
|
|
) -> u32
|
|
|
|
{
|
2024-09-18 22:47:53 +03:00
|
|
|
let page = page::new();
|
|
|
|
|
|
|
|
let page_number = tab.append_page(
|
|
|
|
&page,
|
2024-09-18 22:38:18 +03:00
|
|
|
Some(
|
|
|
|
&label::new()
|
|
|
|
)
|
|
|
|
);
|
2024-09-18 22:47:53 +03:00
|
|
|
|
|
|
|
tab.set_tab_reorderable(
|
|
|
|
&page,
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
if is_current
|
|
|
|
{
|
|
|
|
tab.set_current_page(
|
|
|
|
Some(
|
|
|
|
page_number
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return page_number;
|
2024-09-18 22:07:52 +03:00
|
|
|
}
|