Browse Source

grab focus to page navigation request on entry is empty

master
yggverse 2 months ago
parent
commit
0557d5d099
  1. 6
      src/browser/main/tab.rs
  2. 4
      src/browser/main/tab/page.rs
  3. 4
      src/browser/main/tab/page/navigation.rs

6
src/browser/main/tab.rs

@ -75,7 +75,7 @@ impl Tab { @@ -75,7 +75,7 @@ impl Tab {
let label = Arc::new(Label::new(id.clone(), false));
let page = Arc::new(Page::new(
id.clone(),
page_navigation_request_text,
page_navigation_request_text.clone(),
self.action_tab_page_reload.clone(),
self.action_update.clone(),
));
@ -109,6 +109,10 @@ impl Tab { @@ -109,6 +109,10 @@ impl Tab {
self.widget.set_current_page(Some(page_number));
}
if page_navigation_request_text.is_none() {
page.grab_navigation_request_focus();
}
// Result
page_number
}

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

@ -105,6 +105,10 @@ impl Page { @@ -105,6 +105,10 @@ impl Page {
}
// Actions
pub fn grab_navigation_request_focus(&self) {
self.navigation.grab_request_focus();
}
pub fn reload(&self) {
// Init globals
let request_text = self.navigation.request_text();

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

@ -75,6 +75,10 @@ impl Navigation { @@ -75,6 +75,10 @@ impl Navigation {
}
// Actions
pub fn grab_request_focus(&self) {
self.request.widget().grab_focus();
}
pub fn update(&self, progress_fraction: Option<f64>) {
self.base.update(self.request.uri());
self.history.update();

Loading…
Cancel
Save