mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
use tuple for item options (todo struct)
This commit is contained in:
parent
89d0d13c42
commit
f6d015c8c1
2 changed files with 9 additions and 18 deletions
|
|
@ -112,12 +112,8 @@ impl Tab {
|
||||||
self.widget.gobject(),
|
self.widget.gobject(),
|
||||||
self.browser_action.clone(),
|
self.browser_action.clone(),
|
||||||
self.window_action.clone(),
|
self.window_action.clone(),
|
||||||
// Options
|
// Options tuple
|
||||||
position,
|
(position, request, is_pinned, is_selected, is_load),
|
||||||
request,
|
|
||||||
is_pinned,
|
|
||||||
is_selected,
|
|
||||||
is_load,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// Register dynamically created tab components in the HashMap index
|
// Register dynamically created tab components in the HashMap index
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,12 @@ impl Item {
|
||||||
// Actions
|
// Actions
|
||||||
browser_action: Rc<BrowserAction>,
|
browser_action: Rc<BrowserAction>,
|
||||||
window_action: Rc<WindowAction>,
|
window_action: Rc<WindowAction>,
|
||||||
// Options
|
// Options tuple @TODO struct?
|
||||||
position: Option<i32>,
|
options: (Option<i32>, Option<String>, bool, bool, bool),
|
||||||
request: Option<String>,
|
|
||||||
is_pinned: bool,
|
|
||||||
is_selected: bool,
|
|
||||||
is_load: bool,
|
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
// Get item options from tuple
|
||||||
|
let (position, request, is_pinned, is_selected, is_load) = options;
|
||||||
|
|
||||||
// Generate unique ID for new page components
|
// Generate unique ID for new page components
|
||||||
let id = uuid_string_random();
|
let id = uuid_string_random();
|
||||||
|
|
||||||
|
|
@ -150,12 +149,8 @@ impl Item {
|
||||||
// Actions
|
// Actions
|
||||||
browser_action.clone(),
|
browser_action.clone(),
|
||||||
window_action.clone(),
|
window_action.clone(),
|
||||||
// Options
|
// Options tuple
|
||||||
None,
|
(None, None, record.is_pinned, record.is_selected, false),
|
||||||
None,
|
|
||||||
record.is_pinned,
|
|
||||||
record.is_selected,
|
|
||||||
false,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// Delegate restore action to the item childs
|
// Delegate restore action to the item childs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue