diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index 835c6d7a..67727654 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -50,9 +50,7 @@ impl Item { let page = Rc::new(Page::new( id.clone(), - browser_action, - window_action, - action.clone(), + (browser_action, window_action, action.clone()), )); let widget = Rc::new(Widget::new( diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index fee6ae5a..1c99634e 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -44,20 +44,15 @@ pub struct Page { impl Page { // Constructors - pub fn new( - id: GString, - browser_action: Rc, - window_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn new(id: GString, action: (Rc, Rc, Rc)) -> Self { // Init components - let content = Rc::new(Content::new(window_action.clone(), tab_action.clone())); + let content = Rc::new(Content::new((action.1.clone(), action.2.clone()))); - let navigation = Rc::new(Navigation::new( - browser_action.clone(), - window_action.clone(), - tab_action.clone(), - )); + let navigation = Rc::new(Navigation::new(( + action.0.clone(), + action.1.clone(), + action.2.clone(), + ))); let input = Rc::new(Input::new()); @@ -75,8 +70,8 @@ impl Page { cancellable: RefCell::new(Cancellable::new()), id, // Actions - browser_action, - tab_action, + browser_action: action.0, + tab_action: action.2, // Components content, navigation, diff --git a/src/app/browser/window/tab/item/page/content.rs b/src/app/browser/window/tab/item/page/content.rs index 62875128..658de3a1 100644 --- a/src/app/browser/window/tab/item/page/content.rs +++ b/src/app/browser/window/tab/item/page/content.rs @@ -25,11 +25,11 @@ impl Content { // Construct /// Create new container for different components - pub fn new(window_action: Rc, tab_action: Rc) -> Self { + pub fn new(action: (Rc, Rc)) -> Self { Self { gobject: Box::builder().orientation(Orientation::Vertical).build(), - window_action, - tab_action, + window_action: action.0, + tab_action: action.1, } } diff --git a/src/app/browser/window/tab/item/page/navigation.rs b/src/app/browser/window/tab/item/page/navigation.rs index 5d70b3e3..fe61d952 100644 --- a/src/app/browser/window/tab/item/page/navigation.rs +++ b/src/app/browser/window/tab/item/page/navigation.rs @@ -30,17 +30,13 @@ pub struct Navigation { } impl Navigation { - pub fn new( - browser_action: Rc, - window_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn new(action: (Rc, Rc, Rc)) -> Self { // Init components - let home = Rc::new(Home::new(window_action.clone())); - let history = Rc::new(History::new(window_action.clone())); - let reload = Rc::new(Reload::new(window_action.clone())); - let request = Rc::new(Request::new(browser_action, tab_action)); - let bookmark = Rc::new(Bookmark::new(window_action)); + let home = Rc::new(Home::new(action.1.clone())); + let history = Rc::new(History::new(action.1.clone())); + let reload = Rc::new(Reload::new(action.1.clone())); + let request = Rc::new(Request::new((action.0, action.2))); + let bookmark = Rc::new(Bookmark::new(action.1)); // Init widget let widget = Rc::new(Widget::new( diff --git a/src/app/browser/window/tab/item/page/navigation/request.rs b/src/app/browser/window/tab/item/page/navigation/request.rs index b473ef0a..3aa96d22 100644 --- a/src/app/browser/window/tab/item/page/navigation/request.rs +++ b/src/app/browser/window/tab/item/page/navigation/request.rs @@ -18,13 +18,9 @@ pub struct Request { impl Request { // Construct - pub fn new( - // Actions - browser_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn new(action: (Rc, Rc)) -> Self { Self { - widget: Rc::new(Widget::new(browser_action, tab_action)), + widget: Rc::new(Widget::new(action)), } } diff --git a/src/app/browser/window/tab/item/page/navigation/request/widget.rs b/src/app/browser/window/tab/item/page/navigation/request/widget.rs index cbf5bfaf..3a59bc51 100644 --- a/src/app/browser/window/tab/item/page/navigation/request/widget.rs +++ b/src/app/browser/window/tab/item/page/navigation/request/widget.rs @@ -27,7 +27,7 @@ pub struct Widget { impl Widget { // Construct - pub fn new(browser_action: Rc, tab_action: Rc) -> Self { + pub fn new(action: (Rc, Rc)) -> Self { // Init animated progress bar state let progress = Rc::new(Progress { fraction: RefCell::new(0.0), @@ -42,11 +42,11 @@ impl Widget { // Connect events gobject.connect_changed(move |_| { - browser_action.update().activate(None); + action.0.update().activate(None); }); gobject.connect_activate(move |this| { - tab_action.load().activate(Some(&this.text()), true); + action.1.load().activate(Some(&this.text()), true); }); gobject.connect_state_flags_changed({