rename find action to escape

This commit is contained in:
yggverse 2024-12-16 16:31:35 +02:00
parent 4c572fada6
commit 94b8227088
5 changed files with 12 additions and 12 deletions

View File

@ -152,7 +152,7 @@ impl App {
format!( format!(
"{}.{}", "{}.{}",
browser.action.id, browser.action.id,
browser.action.focus.simple_action.name() browser.action.escape.simple_action.name()
), ),
&["Escape"], &["Escape"],
), ),

View File

@ -69,7 +69,7 @@ impl Browser {
} }
}); });
action.focus.connect_activate({ action.escape.connect_activate({
let widget = widget.clone(); let widget = widget.clone();
move || { move || {
widget.application_window.set_focus(gtk::Window::NONE); widget.application_window.set_focus(gtk::Window::NONE);

View File

@ -1,14 +1,14 @@
mod about; mod about;
mod close; mod close;
mod debug; mod debug;
mod focus; mod escape;
mod profile; mod profile;
mod update; mod update;
use about::About; use about::About;
use close::Close; use close::Close;
use debug::Debug; use debug::Debug;
use focus::Focus; use escape::Escape;
use profile::Profile; use profile::Profile;
use update::Update; use update::Update;
@ -25,7 +25,7 @@ pub struct Action {
pub about: Rc<About>, pub about: Rc<About>,
pub close: Rc<Close>, pub close: Rc<Close>,
pub debug: Rc<Debug>, pub debug: Rc<Debug>,
pub focus: Rc<Focus>, pub escape: Rc<Escape>,
pub profile: Rc<Profile>, pub profile: Rc<Profile>,
pub update: Rc<Update>, pub update: Rc<Update>,
// Group // Group
@ -42,7 +42,7 @@ impl Action {
let about = Rc::new(About::new()); let about = Rc::new(About::new());
let close = Rc::new(Close::new()); let close = Rc::new(Close::new());
let debug = Rc::new(Debug::new()); let debug = Rc::new(Debug::new());
let focus = Rc::new(Focus::new()); let escape = Rc::new(Escape::new());
let profile = Rc::new(Profile::new()); let profile = Rc::new(Profile::new());
let update = Rc::new(Update::new()); let update = Rc::new(Update::new());
@ -56,7 +56,7 @@ impl Action {
simple_action_group.add_action(&about.simple_action); simple_action_group.add_action(&about.simple_action);
simple_action_group.add_action(&close.simple_action); simple_action_group.add_action(&close.simple_action);
simple_action_group.add_action(&debug.simple_action); simple_action_group.add_action(&debug.simple_action);
simple_action_group.add_action(&focus.simple_action); simple_action_group.add_action(&escape.simple_action);
simple_action_group.add_action(&profile.simple_action); simple_action_group.add_action(&profile.simple_action);
simple_action_group.add_action(&update.simple_action); simple_action_group.add_action(&update.simple_action);
@ -65,7 +65,7 @@ impl Action {
about, about,
close, close,
debug, debug,
focus, escape,
profile, profile,
update, update,
id, id,

View File

@ -1,11 +1,11 @@
use gtk::{gio::SimpleAction, glib::uuid_string_random, prelude::ActionExt}; 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 `Escape` action of `Browser` group
pub struct Focus { pub struct Escape {
pub simple_action: SimpleAction, pub simple_action: SimpleAction,
} }
impl Focus { impl Escape {
// Constructors // Constructors
/// Create new `Self` /// Create new `Self`

View File

@ -159,7 +159,7 @@ 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.browser_action.focus.activate(); self.browser_action.escape.activate();
// Initially disable find action // Initially disable find action
self.window_action.find.simple_action.set_enabled(false); self.window_action.find.simple_action.set_enabled(false);