mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
connect focus action
This commit is contained in:
parent
e606ef5fa9
commit
bcf8dcb83a
@ -1,4 +1,4 @@
|
|||||||
use gtk::{gio::SimpleAction, glib::uuid_string_random};
|
use gtk::{gio::SimpleAction, glib::uuid_string_random, prelude::ActionExt};
|
||||||
|
|
||||||
/// [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) wrapper for `Focus` action of `Browser` group
|
/// [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) wrapper for `Focus` action of `Browser` group
|
||||||
pub struct Focus {
|
pub struct Focus {
|
||||||
@ -15,6 +15,14 @@ impl Focus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
|
||||||
|
/// Emit [activate](https://docs.gtk.org/gio/signal.SimpleAction.activate.html) signal
|
||||||
|
/// with formatted for this action [Variant](https://docs.gtk.org/glib/struct.Variant.html) value
|
||||||
|
pub fn activate(&self) {
|
||||||
|
self.gobject.activate(None); // @TODO custom value
|
||||||
|
}
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
|
|
||||||
/// Define callback function for
|
/// Define callback function for
|
||||||
|
@ -149,14 +149,11 @@ impl Page {
|
|||||||
const DEFAULT_MAX_REDIRECT_COUNT: usize = 10;
|
const DEFAULT_MAX_REDIRECT_COUNT: usize = 10;
|
||||||
|
|
||||||
// Move focus out from navigation entry
|
// Move focus out from navigation entry
|
||||||
// self.navigation.reload.widget.gobject.grab_focus();
|
self.browser_action.focus.activate();
|
||||||
|
|
||||||
// Reset widgets
|
// Reset widgets
|
||||||
self.input.unset();
|
self.input.unset();
|
||||||
|
|
||||||
// Create shared variant value
|
|
||||||
let id = self.id.clone();
|
|
||||||
|
|
||||||
// Prevent infinitive redirection
|
// Prevent infinitive redirection
|
||||||
if self.meta.redirects() > DEFAULT_MAX_REDIRECT_COUNT {
|
if self.meta.redirects() > DEFAULT_MAX_REDIRECT_COUNT {
|
||||||
todo!()
|
todo!()
|
||||||
@ -184,7 +181,7 @@ impl Page {
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
self.meta.set_status(Status::Reload).set_title("Loading..");
|
self.meta.set_status(Status::Reload).set_title("Loading..");
|
||||||
self.browser_action.update.activate(Some(&id));
|
self.browser_action.update.activate(Some(&self.id));
|
||||||
|
|
||||||
// Route by request
|
// Route by request
|
||||||
match request {
|
match request {
|
||||||
@ -217,7 +214,7 @@ impl Page {
|
|||||||
.set_title(&status.title());
|
.set_title(&status.title());
|
||||||
|
|
||||||
// Update window
|
// Update window
|
||||||
self.browser_action.update.activate(Some(&id));
|
self.browser_action.update.activate(Some(&self.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user