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

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

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

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

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

Loading…
Cancel
Save