mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
update navigation request on middle click the link
This commit is contained in:
parent
ee92777039
commit
6ccaf9d4c5
@ -85,7 +85,7 @@ impl Tab {
|
||||
action_tab_page_navigation_history_forward.clone();
|
||||
let action_tab_page_navigation_reload = action_tab_page_navigation_reload.clone();
|
||||
let action_update = action_update.clone();
|
||||
move |_, _| {
|
||||
move |_, request| {
|
||||
// Init new tab item
|
||||
let item = Item::new_arc(
|
||||
&gobject,
|
||||
@ -99,11 +99,18 @@ impl Tab {
|
||||
action_update.clone(),
|
||||
// Options
|
||||
false,
|
||||
false, // open on background
|
||||
false,
|
||||
);
|
||||
|
||||
// Register dynamically created tab components in the HashMap index
|
||||
index.borrow_mut().insert(item.id(), item.clone());
|
||||
|
||||
// Set navigation request
|
||||
if let Some(variant) = request {
|
||||
if let Some(value) = variant.get::<String>() {
|
||||
item.set_page_navigation_request_text(value.as_str())
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -195,6 +195,11 @@ impl Item {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Setters
|
||||
pub fn set_page_navigation_request_text(&self, value: &str) {
|
||||
self.page.set_navigation_request_text(value);
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn id(&self) -> GString {
|
||||
self.id.clone()
|
||||
|
@ -522,6 +522,11 @@ impl Page {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Setters
|
||||
pub fn set_navigation_request_text(&self, value: &str) {
|
||||
self.navigation.set_request_text(value);
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn progress_fraction(&self) -> Option<f64> {
|
||||
// Interpret status to progress fraction
|
||||
|
Loading…
x
Reference in New Issue
Block a user