mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement stateful api for append action
This commit is contained in:
parent
a6ef61486d
commit
3a0deabc14
5 changed files with 102 additions and 17 deletions
|
|
@ -99,7 +99,7 @@ impl Tab {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn append(&self, position: Option<i32>) -> Rc<Item> {
|
||||
pub fn append(&self, position: Option<i32>, is_pinned: bool, is_selected: bool) -> Rc<Item> {
|
||||
// Init new tab item
|
||||
let item = Rc::new(Item::new(
|
||||
self.widget.gobject(),
|
||||
|
|
@ -107,8 +107,8 @@ impl Tab {
|
|||
self.window_action.clone(),
|
||||
// Options
|
||||
position,
|
||||
false,
|
||||
true,
|
||||
is_pinned,
|
||||
is_selected,
|
||||
));
|
||||
|
||||
// Register dynamically created tab components in the HashMap index
|
||||
|
|
@ -305,7 +305,7 @@ impl Tab {
|
|||
pub fn init(&self) {
|
||||
// Append just one blank page if no tabs available after last session restore
|
||||
if self.index.borrow().is_empty() {
|
||||
self.append(None);
|
||||
self.append(None, false, true);
|
||||
}
|
||||
|
||||
// @TODO other/child features..
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue