|
|
@ -1,7 +1,7 @@ |
|
|
|
use gtk::{ |
|
|
|
use gtk::{ |
|
|
|
gio::SimpleAction, |
|
|
|
gio::SimpleAction, |
|
|
|
glib::{GString, Uri, UriFlags}, |
|
|
|
glib::{GString, Uri, UriFlags}, |
|
|
|
prelude::{ActionExt, EditableExt, EntryExt, WidgetExt}, |
|
|
|
prelude::{ActionExt, EditableExt, EntryExt}, |
|
|
|
Entry, |
|
|
|
Entry, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -13,7 +13,11 @@ pub struct Request { |
|
|
|
|
|
|
|
|
|
|
|
impl Request { |
|
|
|
impl Request { |
|
|
|
// Construct
|
|
|
|
// Construct
|
|
|
|
pub fn new(text: Option<GString>, action_update: Arc<SimpleAction>) -> Self { |
|
|
|
pub fn new( |
|
|
|
|
|
|
|
text: Option<GString>, |
|
|
|
|
|
|
|
action_update: Arc<SimpleAction>, |
|
|
|
|
|
|
|
tab_page_reload: Arc<SimpleAction>, |
|
|
|
|
|
|
|
) -> Self { |
|
|
|
// GTK
|
|
|
|
// GTK
|
|
|
|
let widget = Entry::builder() |
|
|
|
let widget = Entry::builder() |
|
|
|
.placeholder_text("URL or search term...") |
|
|
|
.placeholder_text("URL or search term...") |
|
|
@ -31,10 +35,8 @@ impl Request { |
|
|
|
action_update.activate(None); |
|
|
|
action_update.activate(None); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
widget.connect_activate(|entry| { |
|
|
|
widget.connect_activate(move |_| { |
|
|
|
entry |
|
|
|
tab_page_reload.activate(None); |
|
|
|
.activate_action("win.tab_page_reload", None) // @TODO
|
|
|
|
|
|
|
|
.expect("Action `win.tab_page_reload` not found") |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Result
|
|
|
|
// Result
|
|
|
|