rename actions

This commit is contained in:
yggverse 2024-09-30 23:29:08 +03:00
parent 28684b8ef9
commit 359950540e
4 changed files with 14 additions and 14 deletions

View file

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

View file

@ -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 {
}
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()));
}
}

View file

@ -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 {
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>) {

View file

@ -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 {
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 {
}
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),
};