diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index bada0ffa..ee8e5b5d 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -237,7 +237,7 @@ impl Page { let title = "Titan input"; // Toggle input form - self.input.set_new_titan(&self.tab_action, uri, Some(title)); + // @TODO self.input.set_new_titan(|data|{}); // Update meta self.meta.set_status(status).set_title(title); diff --git a/src/app/browser/window/tab/item/page/input.rs b/src/app/browser/window/tab/item/page/input.rs index f10b3af9..cce564f1 100644 --- a/src/app/browser/window/tab/item/page/input.rs +++ b/src/app/browser/window/tab/item/page/input.rs @@ -66,8 +66,8 @@ impl Input { )); } - pub fn set_new_titan(&self, action: &Rc, base: &Uri, title: Option<&str>) { + pub fn set_new_titan(&self, callback: impl Fn(&[u8]) + 'static) { self.widget - .update(Some(&Titan::build(action, base, title).widget.g_box)); + .update(Some(&Titan::build(callback).widget.g_box)); } } diff --git a/src/app/browser/window/tab/item/page/input/titan.rs b/src/app/browser/window/tab/item/page/input/titan.rs index 69b759b7..9d78f84f 100644 --- a/src/app/browser/window/tab/item/page/input/titan.rs +++ b/src/app/browser/window/tab/item/page/input/titan.rs @@ -8,11 +8,7 @@ use form::Form; use title::Title; use widget::Widget; -use super::TabAction; -use gtk::{ - gio::SimpleAction, - glib::{uuid_string_random, Uri}, -}; +use gtk::{gio::SimpleAction, glib::uuid_string_random}; use std::rc::Rc; pub struct Titan { @@ -24,7 +20,7 @@ impl Titan { // Constructors /// Build new `Self` - pub fn build(_tab_action: &Rc, _base: &Uri, title: Option<&str>) -> Self { + pub fn build(callback: impl Fn(&[u8]) + 'static) -> Self { // Init local actions let action_update = SimpleAction::new(&uuid_string_random(), None); let action_send = SimpleAction::new(&uuid_string_random(), None); @@ -32,7 +28,7 @@ impl Titan { // Init components let control = Rc::new(Control::build(action_send.clone())); let form = Rc::new(Form::build(action_update.clone())); - let title = Rc::new(Title::build(title)); + let title = Rc::new(Title::build(None)); // @TODO // Init widget let widget = Rc::new(Widget::build( @@ -50,13 +46,7 @@ impl Titan { action_send.connect_activate({ // @TODO let form = form.clone(); - move |_, _| { - todo!() - /* tab_action.load.activate( - Some(&), - true, - );*/ - } + move |_, _| callback(&[]) // @TODO input data }); // Return activated struct