diff --git a/src/app.rs b/src/app.rs index 2aea7f3b..20143beb 100644 --- a/src/app.rs +++ b/src/app.rs @@ -48,7 +48,7 @@ impl App { let action_page_new = Action::new("win", true, None); let action_page_close = Action::new("win", true, None); let action_page_close_all = Action::new("win", true, None); - let action_page_base = Action::new("win", false, None); + let action_page_home = Action::new("win", false, None); let action_page_history_back = Action::new("win", false, None); let action_page_history_forward = Action::new("win", false, None); let action_page_reload = Action::new("win", true, None); @@ -66,7 +66,7 @@ impl App { gobject.set_accels_for_action(&action_page_new.detailed_name(), &["t"]); gobject.set_accels_for_action(&action_page_pin.detailed_name(), &["p"]); gobject.set_accels_for_action(&action_page_close.detailed_name(), &["q"]); - gobject.set_accels_for_action(&action_page_base.detailed_name(), &["h"]); + gobject.set_accels_for_action(&action_page_home.detailed_name(), &["h"]); gobject.set_accels_for_action( &action_page_history_back.detailed_name(), &["Left"], @@ -87,7 +87,7 @@ impl App { action_page_new.simple(), action_page_close.simple(), action_page_close_all.simple(), - action_page_base.simple(), + action_page_home.simple(), action_page_history_back.simple(), action_page_history_forward.simple(), action_page_reload.simple(), diff --git a/src/app/browser.rs b/src/app/browser.rs index 11ccdcb2..3327b6ff 100644 --- a/src/app/browser.rs +++ b/src/app/browser.rs @@ -35,7 +35,7 @@ impl Browser { action_page_new: SimpleAction, action_page_close: SimpleAction, action_page_close_all: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -49,7 +49,7 @@ impl Browser { action_page_new.clone(), action_page_close.clone(), action_page_close_all.clone(), - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -67,7 +67,7 @@ impl Browser { widget.gobject().add_action(&action_page_new); widget.gobject().add_action(&action_page_close); widget.gobject().add_action(&action_page_close_all); - widget.gobject().add_action(&action_page_base); + widget.gobject().add_action(&action_page_home); widget.gobject().add_action(&action_page_history_back); widget.gobject().add_action(&action_page_history_forward); widget.gobject().add_action(&action_page_reload); @@ -136,10 +136,10 @@ impl Browser { } }); - action_page_base.connect_activate({ + action_page_home.connect_activate({ let window = window.clone(); move |_, _| { - window.tab_page_navigation_base(); + window.tab_page_navigation_home(); } }); diff --git a/src/app/browser/window.rs b/src/app/browser/window.rs index b84d6dfc..8c2b22e5 100644 --- a/src/app/browser/window.rs +++ b/src/app/browser/window.rs @@ -30,7 +30,7 @@ impl Window { action_page_new: SimpleAction, action_page_close: SimpleAction, action_page_close_all: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -38,7 +38,7 @@ impl Window { ) -> Self { // Init components let tab = Tab::new_arc( - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -53,7 +53,7 @@ impl Window { action_page_new.clone(), action_page_close.clone(), action_page_close_all.clone(), - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -78,8 +78,8 @@ impl Window { self.tab.append(position); } - pub fn tab_page_navigation_base(&self) { - self.tab.page_navigation_base(); + pub fn tab_page_navigation_home(&self) { + self.tab.page_navigation_home(); } pub fn tab_page_navigation_history_back(&self) { diff --git a/src/app/browser/window/header.rs b/src/app/browser/window/header.rs index 2f82d02c..24a61a4b 100644 --- a/src/app/browser/window/header.rs +++ b/src/app/browser/window/header.rs @@ -22,7 +22,7 @@ impl Header { action_page_new: SimpleAction, action_page_close: SimpleAction, action_page_close_all: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -38,7 +38,7 @@ impl Header { action_page_new, action_page_close, action_page_close_all, - action_page_base, + action_page_home, action_page_history_back, action_page_history_forward, action_page_reload, diff --git a/src/app/browser/window/header/bar.rs b/src/app/browser/window/header/bar.rs index f9a83200..a8d33cf9 100644 --- a/src/app/browser/window/header/bar.rs +++ b/src/app/browser/window/header/bar.rs @@ -25,7 +25,7 @@ impl Bar { action_page_new: SimpleAction, action_page_close: SimpleAction, action_page_close_all: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -42,7 +42,7 @@ impl Bar { action_page_new, action_page_close, action_page_close_all, - action_page_base, + action_page_home, action_page_history_back, action_page_history_forward, action_page_reload, diff --git a/src/app/browser/window/header/bar/menu.rs b/src/app/browser/window/header/bar/menu.rs index 7c3d6041..be9a34a1 100644 --- a/src/app/browser/window/header/bar/menu.rs +++ b/src/app/browser/window/header/bar/menu.rs @@ -23,7 +23,7 @@ impl Menu { action_page_new: SimpleAction, action_page_close: SimpleAction, action_page_close_all: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -40,7 +40,7 @@ impl Menu { // Main > Page > Navigation let main_page_navigation = gio::Menu::new(); - main_page_navigation.append(Some("Base"), Some(&detailed_action_name(action_page_base))); + main_page_navigation.append(Some("Home"), Some(&detailed_action_name(action_page_home))); // Main > Page > Navigation > History let main_page_navigation_history = gio::Menu::new(); diff --git a/src/app/browser/window/tab.rs b/src/app/browser/window/tab.rs index 65ff8893..8968937c 100644 --- a/src/app/browser/window/tab.rs +++ b/src/app/browser/window/tab.rs @@ -20,7 +20,7 @@ pub struct Tab { // Local actions action_tab_open: SimpleAction, // Global actions - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -35,7 +35,7 @@ impl Tab { // Construct pub fn new_arc( // Actions - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -76,7 +76,7 @@ impl Tab { let gobject = widget.gobject().clone(); // Actions let action_tab_open = action_tab_open.clone(); - let action_page_base = action_page_base.clone(); + let action_page_home = action_page_home.clone(); let action_page_history_back = action_page_history_back.clone(); let action_page_history_forward = action_page_history_forward.clone(); let action_page_reload = action_page_reload.clone(); @@ -88,7 +88,7 @@ impl Tab { // Local actions action_tab_open.clone(), // Global actions - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -120,7 +120,7 @@ impl Tab { // Local actions action_tab_open, // Global actions - action_page_base, + action_page_home, action_page_history_back, action_page_history_forward, action_page_reload, @@ -140,7 +140,7 @@ impl Tab { // Local actions self.action_tab_open.clone(), // Global actions - self.action_page_base.clone(), + self.action_page_home.clone(), self.action_page_history_back.clone(), self.action_page_history_forward.clone(), self.action_page_reload.clone(), @@ -177,10 +177,10 @@ impl Tab { } } - pub fn page_navigation_base(&self) { + pub fn page_navigation_home(&self) { if let Some(id) = self.widget.current_page_keyword() { if let Some(item) = self.index.borrow().get(&id) { - item.page_navigation_base(); + item.page_navigation_home(); } } } @@ -277,7 +277,7 @@ impl Tab { transaction, &record.id, self.action_tab_open.clone(), - self.action_page_base.clone(), + self.action_page_home.clone(), self.action_page_history_back.clone(), self.action_page_history_forward.clone(), self.action_page_reload.clone(), diff --git a/src/app/browser/window/tab/item.rs b/src/app/browser/window/tab/item.rs index b00195b2..9ef3bdfa 100644 --- a/src/app/browser/window/tab/item.rs +++ b/src/app/browser/window/tab/item.rs @@ -29,7 +29,7 @@ impl Item { tab_view: &TabView, // Actions action_tab_open: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -47,7 +47,7 @@ impl Item { id.clone(), // Actions action_tab_open.clone(), - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -69,8 +69,8 @@ impl Item { } // Actions - pub fn page_navigation_base(&self) { - self.page.navigation_base() + pub fn page_navigation_home(&self) { + self.page.navigation_home() } pub fn page_navigation_history_back(&self) { @@ -129,7 +129,7 @@ impl Item { app_browser_window_tab_id: &i64, // Actions action_tab_open: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -145,7 +145,7 @@ impl Item { tab_view, // Actions action_tab_open.clone(), - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index 014bb9dc..c44e358a 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -52,7 +52,7 @@ impl Page { pub fn new_arc( id: GString, action_tab_open: SimpleAction, - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, @@ -66,7 +66,7 @@ impl Page { let content = Content::new_arc(action_tab_open.clone(), action_page_open.clone()); let navigation = Navigation::new_arc( - action_page_base.clone(), + action_page_home.clone(), action_page_history_back.clone(), action_page_history_forward.clone(), action_page_reload.clone(), @@ -128,8 +128,8 @@ impl Page { self.navigation.request_grab_focus(); } - pub fn navigation_base(&self) { - if let Some(url) = self.navigation.base_url() { + pub fn navigation_home(&self) { + if let Some(url) = self.navigation.home_url() { // Update with history record self.action_page_open.activate(Some(&url.to_variant())); } diff --git a/src/app/browser/window/tab/item/page/navigation.rs b/src/app/browser/window/tab/item/page/navigation.rs index 8ee8291d..7ec12a05 100644 --- a/src/app/browser/window/tab/item/page/navigation.rs +++ b/src/app/browser/window/tab/item/page/navigation.rs @@ -1,15 +1,15 @@ -mod base; mod bookmark; mod database; mod history; +mod home; mod reload; mod request; mod widget; -use base::Base; use bookmark::Bookmark; use database::Database; use history::History; +use home::Home; use reload::Reload; use request::Request; use widget::Widget; @@ -20,7 +20,7 @@ use sqlite::Transaction; use std::sync::Arc; pub struct Navigation { - base: Arc, + home: Arc, bookmark: Arc, history: Arc, reload: Arc, @@ -30,28 +30,22 @@ pub struct Navigation { impl Navigation { pub fn new_arc( - action_page_base: SimpleAction, + action_page_home: SimpleAction, action_page_history_back: SimpleAction, action_page_history_forward: SimpleAction, action_page_reload: SimpleAction, action_update: SimpleAction, ) -> Arc { // Init components - let base = Base::new_arc(action_page_base); - let history = History::new_arc( - action_page_history_back, - action_page_history_forward, - ); + let home = Home::new_arc(action_page_home); + let history = History::new_arc(action_page_history_back, action_page_history_forward); let reload = Reload::new_arc(action_page_reload.clone()); - let request = Request::new_arc( - action_update.clone(), - action_page_reload.clone(), - ); + let request = Request::new_arc(action_update.clone(), action_page_reload.clone()); let bookmark = Bookmark::new_arc(); // Init widget let widget = Widget::new_arc( - base.gobject(), + home.gobject(), history.gobject(), reload.gobject(), request.gobject(), @@ -61,7 +55,7 @@ impl Navigation { // Result Arc::new(Self { widget, - base, + home, history, reload, request, @@ -91,7 +85,7 @@ impl Navigation { } pub fn update(&self, progress_fraction: Option) { - self.base.update(self.request.uri()); + self.home.update(self.request.uri()); self.history.update(); self.reload.update(!self.request.is_empty()); self.request.update(progress_fraction); @@ -167,8 +161,8 @@ impl Navigation { &self.widget.gobject() } - pub fn base_url(&self) -> Option { - self.base.url() + pub fn home_url(&self) -> Option { + self.home.url() } pub fn request_text(&self) -> GString { diff --git a/src/app/browser/window/tab/item/page/navigation/base.rs b/src/app/browser/window/tab/item/page/navigation/home.rs similarity index 81% rename from src/app/browser/window/tab/item/page/navigation/base.rs rename to src/app/browser/window/tab/item/page/navigation/home.rs index 78276440..35491dd2 100644 --- a/src/app/browser/window/tab/item/page/navigation/base.rs +++ b/src/app/browser/window/tab/item/page/navigation/home.rs @@ -9,19 +9,19 @@ use gtk::{ }; use std::{cell::RefCell, sync::Arc}; -pub struct Base { - action_page_base: SimpleAction, +pub struct Home { + action_page_home: SimpleAction, uri: RefCell>, widget: Arc, } -impl Base { +impl Home { // Construct - pub fn new_arc(action_page_base: SimpleAction) -> Arc { + pub fn new_arc(action_page_home: SimpleAction) -> Arc { Arc::new(Self { - action_page_base: action_page_base.clone(), + action_page_home: action_page_home.clone(), uri: RefCell::new(None), - widget: Widget::new_arc(action_page_base), + widget: Widget::new_arc(action_page_home), }) } @@ -37,7 +37,7 @@ impl Base { self.uri.replace(uri); // Update action status - self.action_page_base.set_enabled(status); + self.action_page_home.set_enabled(status); // Update child components self.widget.update(status); diff --git a/src/app/browser/window/tab/item/page/navigation/base/widget.rs b/src/app/browser/window/tab/item/page/navigation/home/widget.rs similarity index 78% rename from src/app/browser/window/tab/item/page/navigation/base/widget.rs rename to src/app/browser/window/tab/item/page/navigation/home/widget.rs index 5bced5e0..490ab0a7 100644 --- a/src/app/browser/window/tab/item/page/navigation/base/widget.rs +++ b/src/app/browser/window/tab/item/page/navigation/home/widget.rs @@ -11,19 +11,19 @@ pub struct Widget { impl Widget { // Construct - pub fn new_arc(action_page_base: SimpleAction) -> Arc { + pub fn new_arc(action_page_home: SimpleAction) -> Arc { // Init gobject let gobject = Button::builder() .icon_name("go-home-symbolic") - .tooltip_text("Base") + .tooltip_text("Home") .sensitive(false) .build(); // Init events gobject.connect_clicked({ - let action_page_base = action_page_base.clone(); + let action_page_home = action_page_home.clone(); move |_| { - action_page_base.activate(None); + action_page_home.activate(None); } });