mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-28 20:14:13 +00:00
use tuple for actions
This commit is contained in:
parent
fc2baf7845
commit
1b6f45152a
@ -24,8 +24,7 @@ use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
|||||||
// Main
|
// Main
|
||||||
pub struct Tab {
|
pub struct Tab {
|
||||||
profile: Rc<Profile>,
|
profile: Rc<Profile>,
|
||||||
browser_action: Rc<BrowserAction>,
|
actions: (Rc<BrowserAction>, Rc<WindowAction>),
|
||||||
window_action: Rc<WindowAction>,
|
|
||||||
index: Rc<RefCell<HashMap<GString, Rc<Item>>>>,
|
index: Rc<RefCell<HashMap<GString, Rc<Item>>>>,
|
||||||
widget: Rc<Widget>,
|
widget: Rc<Widget>,
|
||||||
}
|
}
|
||||||
@ -100,8 +99,7 @@ impl Tab {
|
|||||||
// Return activated `Self`
|
// Return activated `Self`
|
||||||
Self {
|
Self {
|
||||||
profile,
|
profile,
|
||||||
browser_action: action.0,
|
actions: (action.0, action.1),
|
||||||
window_action: action.1,
|
|
||||||
index,
|
index,
|
||||||
widget,
|
widget,
|
||||||
}
|
}
|
||||||
@ -121,9 +119,9 @@ impl Tab {
|
|||||||
let item = Rc::new(Item::new(
|
let item = Rc::new(Item::new(
|
||||||
self.widget.gobject(),
|
self.widget.gobject(),
|
||||||
self.profile.clone(),
|
self.profile.clone(),
|
||||||
self.browser_action.clone(),
|
// Actions
|
||||||
self.window_action.clone(),
|
(self.actions.0.clone(), self.actions.1.clone()),
|
||||||
// Options tuple
|
// Options
|
||||||
(
|
(
|
||||||
position,
|
position,
|
||||||
request,
|
request,
|
||||||
@ -294,7 +292,7 @@ impl Tab {
|
|||||||
transaction,
|
transaction,
|
||||||
&record.id,
|
&record.id,
|
||||||
self.profile.clone(),
|
self.profile.clone(),
|
||||||
(self.browser_action.clone(), self.window_action.clone()),
|
(self.actions.0.clone(), self.actions.1.clone()),
|
||||||
) {
|
) {
|
||||||
Ok(items) => {
|
Ok(items) => {
|
||||||
for item in items {
|
for item in items {
|
||||||
|
@ -34,10 +34,7 @@ impl Item {
|
|||||||
pub fn new(
|
pub fn new(
|
||||||
tab_view: &TabView,
|
tab_view: &TabView,
|
||||||
profile: Rc<Profile>,
|
profile: Rc<Profile>,
|
||||||
// Actions
|
actions: (Rc<BrowserAction>, Rc<WindowAction>),
|
||||||
browser_action: Rc<BrowserAction>,
|
|
||||||
window_action: Rc<WindowAction>,
|
|
||||||
// Options tuple @TODO struct?
|
|
||||||
options: (Position, Option<String>, bool, bool, bool, bool),
|
options: (Position, Option<String>, bool, bool, bool, bool),
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// Get item options from tuple
|
// Get item options from tuple
|
||||||
@ -53,7 +50,7 @@ impl Item {
|
|||||||
let page = Rc::new(Page::new(
|
let page = Rc::new(Page::new(
|
||||||
id.clone(),
|
id.clone(),
|
||||||
profile,
|
profile,
|
||||||
(browser_action, window_action, action.clone()),
|
(actions.0, actions.1, action.clone()),
|
||||||
));
|
));
|
||||||
|
|
||||||
let widget = Rc::new(Widget::new(
|
let widget = Rc::new(Widget::new(
|
||||||
@ -154,8 +151,7 @@ impl Item {
|
|||||||
tab_view,
|
tab_view,
|
||||||
profile.clone(),
|
profile.clone(),
|
||||||
// Actions
|
// Actions
|
||||||
action.0.clone(),
|
(action.0.clone(), action.1.clone()),
|
||||||
action.1.clone(),
|
|
||||||
// Options tuple
|
// Options tuple
|
||||||
(
|
(
|
||||||
Position::End,
|
Position::End,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user