Browse Source

rename actions

master
yggverse 2 months ago
parent
commit
359950540e
  1. 2
      src/browser/main/tab.rs
  2. 8
      src/browser/main/tab/page.rs
  3. 10
      src/browser/main/tab/page/navigation.rs
  4. 8
      src/browser/main/tab/page/navigation/history.rs

2
src/browser/main/tab.rs

@ -122,7 +122,7 @@ impl Tab { @@ -122,7 +122,7 @@ impl Tab {
}
if page_navigation_request_text.is_none() {
page.grab_navigation_request_focus();
page.navigation_request_grab_focus();
}
// Result

8
src/browser/main/tab/page.rs

@ -116,8 +116,8 @@ impl Page { @@ -116,8 +116,8 @@ impl Page {
}
// Actions
pub fn grab_navigation_request_focus(&self) {
self.navigation.grab_request_focus();
pub fn navigation_request_grab_focus(&self) {
self.navigation.request_grab_focus();
}
pub fn navigation_base(&self) {
@ -127,13 +127,13 @@ impl Page { @@ -127,13 +127,13 @@ impl Page {
}
pub fn navigation_history_back(&self) {
if let Some(url) = self.navigation.history_try_back() {
if let Some(url) = self.navigation.history_back() {
self.action_page_open.activate(Some(&url.to_variant()));
}
}
pub fn navigation_history_forward(&self) {
if let Some(url) = self.navigation.history_try_forward() {
if let Some(url) = self.navigation.history_forward() {
self.action_page_open.activate(Some(&url.to_variant()));
}
}

10
src/browser/main/tab/page/navigation.rs

@ -81,7 +81,7 @@ impl Navigation { @@ -81,7 +81,7 @@ impl Navigation {
}
// Actions
pub fn grab_request_focus(&self) {
pub fn request_grab_focus(&self) {
self.request.widget().grab_focus();
}
@ -89,12 +89,12 @@ impl Navigation { @@ -89,12 +89,12 @@ impl Navigation {
self.history.add(request, true);
}
pub fn history_try_back(&self) -> Option<GString> {
self.history.try_back(true)
pub fn history_back(&self) -> Option<GString> {
self.history.back(true)
}
pub fn history_try_forward(&self) -> Option<GString> {
self.history.try_forward(true)
pub fn history_forward(&self) -> Option<GString> {
self.history.forward(true)
}
pub fn update(&self, progress_fraction: Option<f64>) {

8
src/browser/main/tab/page/navigation/history.rs

@ -76,7 +76,7 @@ impl History { @@ -76,7 +76,7 @@ impl History {
}
}
pub fn try_back(&self, follow_to_index: bool) -> Option<GString> {
pub fn back(&self, follow_to_index: bool) -> Option<GString> {
if let Some(index) = self.index.borrow().as_ref() {
if let Some(memory) = self.memory.borrow().get(index - 1) {
if follow_to_index {
@ -88,7 +88,7 @@ impl History { @@ -88,7 +88,7 @@ impl History {
None
}
pub fn try_forward(&self, follow_to_index: bool) -> Option<GString> {
pub fn forward(&self, follow_to_index: bool) -> Option<GString> {
if let Some(index) = self.index.borrow().as_ref() {
if let Some(memory) = self.memory.borrow().get(index + 1) {
if follow_to_index {
@ -101,12 +101,12 @@ impl History { @@ -101,12 +101,12 @@ impl History {
}
pub fn update(&self) {
match self.try_back(false) {
match self.back(false) {
Some(_) => self.back.update(true),
None => self.back.update(false),
};
match self.try_forward(false) {
match self.forward(false) {
Some(_) => self.forward.update(true),
None => self.forward.update(false),
};

Loading…
Cancel
Save