diff --git a/src/app/browser/window/tab/item/page/content.rs b/src/app/browser/window/tab/item/page/content.rs index 0101aa2d..62875128 100644 --- a/src/app/browser/window/tab/item/page/content.rs +++ b/src/app/browser/window/tab/item/page/content.rs @@ -85,8 +85,7 @@ impl Content { let text = Text::gemini( data, base, - self.window_action.clone(), - self.tab_action.clone(), + (self.window_action.clone(), self.tab_action.clone()), ); self.gobject.append(text.gobject()); text diff --git a/src/app/browser/window/tab/item/page/content/text.rs b/src/app/browser/window/tab/item/page/content/text.rs index 45d84910..f38ba6e7 100644 --- a/src/app/browser/window/tab/item/page/content/text.rs +++ b/src/app/browser/window/tab/item/page/content/text.rs @@ -20,14 +20,9 @@ pub struct Text { impl Text { // Construct - pub fn gemini( - gemtext: &str, - base: &Uri, - window_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn gemini(gemtext: &str, base: &Uri, actions: (Rc, Rc)) -> Self { // Init components - let gemini = Gemini::new(gemtext, base, window_action, tab_action); + let gemini = Gemini::new(gemtext, base, actions); // Init meta let meta = Meta { diff --git a/src/app/browser/window/tab/item/page/content/text/gemini.rs b/src/app/browser/window/tab/item/page/content/text/gemini.rs index d08ebfbf..a7c23679 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini.rs @@ -16,14 +16,9 @@ pub struct Gemini { impl Gemini { // Construct - pub fn new( - gemtext: &str, - base: &Uri, - window_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn new(gemtext: &str, base: &Uri, actions: (Rc, Rc)) -> Self { // Init components - let reader = Rc::new(Reader::new(gemtext, base, window_action, tab_action)); + let reader = Rc::new(Reader::new(gemtext, base, actions)); let widget = Rc::new(Widget::new(reader.gobject())); // Result diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs index cd28cc86..3323e6ba 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader.rs @@ -30,12 +30,7 @@ pub struct Reader { impl Reader { // Construct - pub fn new( - gemtext: &str, - base: &Uri, - window_action: Rc, - tab_action: Rc, - ) -> Self { + pub fn new(gemtext: &str, base: &Uri, actions: (Rc, Rc)) -> Self { // Init default values let mut title = None; @@ -232,7 +227,6 @@ impl Reader { // Init events primary_button_controller.connect_released({ - let tab_action = tab_action.clone(); let gobject = widget.gobject().clone(); let _links_ = links.clone(); // is copy move |_, _, window_x, window_y| { @@ -251,7 +245,7 @@ impl Reader { return match uri.scheme().as_str() { "gemini" => { // Open new page in browser - tab_action.load().activate(Some(&uri.to_str())); + actions.1.load().activate(Some(&uri.to_str())); } // Scheme not supported, delegate _ => UriLauncher::new(&uri.to_str()).launch( @@ -288,7 +282,7 @@ impl Reader { return match uri.scheme().as_str() { "gemini" => { // Open new page in browser - window_action.append().activate_stateful_once( + actions.0.append().activate_stateful_once( None, Some(uri.to_string()), false,