From 94b82270885b6ab6e1771cd39992c1c580dbc4e1 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 16 Dec 2024 16:31:35 +0200 Subject: [PATCH] rename `find` action to `escape` --- src/app.rs | 2 +- src/app/browser.rs | 2 +- src/app/browser/action.rs | 12 ++++++------ src/app/browser/action/{focus.rs => escape.rs} | 6 +++--- src/app/browser/window/tab/item/page.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename src/app/browser/action/{focus.rs => escape.rs} (91%) diff --git a/src/app.rs b/src/app.rs index 14d1f461..de3a1f85 100644 --- a/src/app.rs +++ b/src/app.rs @@ -152,7 +152,7 @@ impl App { format!( "{}.{}", browser.action.id, - browser.action.focus.simple_action.name() + browser.action.escape.simple_action.name() ), &["Escape"], ), diff --git a/src/app/browser.rs b/src/app/browser.rs index a96e815b..65eb2cbd 100644 --- a/src/app/browser.rs +++ b/src/app/browser.rs @@ -69,7 +69,7 @@ impl Browser { } }); - action.focus.connect_activate({ + action.escape.connect_activate({ let widget = widget.clone(); move || { widget.application_window.set_focus(gtk::Window::NONE); diff --git a/src/app/browser/action.rs b/src/app/browser/action.rs index 920aab22..bbd1ac1e 100644 --- a/src/app/browser/action.rs +++ b/src/app/browser/action.rs @@ -1,14 +1,14 @@ mod about; mod close; mod debug; -mod focus; +mod escape; mod profile; mod update; use about::About; use close::Close; use debug::Debug; -use focus::Focus; +use escape::Escape; use profile::Profile; use update::Update; @@ -25,7 +25,7 @@ pub struct Action { pub about: Rc, pub close: Rc, pub debug: Rc, - pub focus: Rc, + pub escape: Rc, pub profile: Rc, pub update: Rc, // Group @@ -42,7 +42,7 @@ impl Action { let about = Rc::new(About::new()); let close = Rc::new(Close::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 update = Rc::new(Update::new()); @@ -56,7 +56,7 @@ impl Action { simple_action_group.add_action(&about.simple_action); simple_action_group.add_action(&close.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(&update.simple_action); @@ -65,7 +65,7 @@ impl Action { about, close, debug, - focus, + escape, profile, update, id, diff --git a/src/app/browser/action/focus.rs b/src/app/browser/action/escape.rs similarity index 91% rename from src/app/browser/action/focus.rs rename to src/app/browser/action/escape.rs index ade849cc..922adb3f 100644 --- a/src/app/browser/action/focus.rs +++ b/src/app/browser/action/escape.rs @@ -1,11 +1,11 @@ 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 -pub struct Focus { +/// [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) wrapper for `Escape` action of `Browser` group +pub struct Escape { pub simple_action: SimpleAction, } -impl Focus { +impl Escape { // Constructors /// Create new `Self` diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index be08f422..f0aafe6f 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -159,7 +159,7 @@ impl Page { const DEFAULT_MAX_REDIRECT_COUNT: usize = 10; // Move focus out from navigation entry - self.browser_action.focus.activate(); + self.browser_action.escape.activate(); // Initially disable find action self.window_action.find.simple_action.set_enabled(false);