mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
store entire closed tab item to restore all features
This commit is contained in:
parent
27ee3e8fe9
commit
1a0b31e695
6 changed files with 36 additions and 26 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use super::{BrowserAction, Profile, WindowAction};
|
||||
use gtk::{
|
||||
gio::{self},
|
||||
prelude::{ActionExt, ToVariant},
|
||||
prelude::{ActionExt, EditableExt, ToVariant},
|
||||
Align, MenuButton,
|
||||
};
|
||||
use std::rc::Rc;
|
||||
|
|
@ -206,13 +206,14 @@ impl Menu {
|
|||
|
||||
// History
|
||||
main_history_closed.remove_all();
|
||||
for request in profile.history.memory.closed.recent(RECENTLY_CLOSED) {
|
||||
let menu_item = gio::MenuItem::new(Some(&label(&request, LABEL_MAX_LENGTH)), None);
|
||||
for item in profile.history.memory.closed.recent(RECENTLY_CLOSED) {
|
||||
let item_request = item.page.navigation.request.widget.entry.text(); // @TODO restore entire `Item`
|
||||
let menu_item = gio::MenuItem::new(Some(&label(&item_request, LABEL_MAX_LENGTH)), None);
|
||||
menu_item.set_action_and_target_value(Some(&format!(
|
||||
"{}.{}",
|
||||
window_action.id,
|
||||
window_action.open.simple_action.name()
|
||||
)), Some(&request.to_variant()));
|
||||
)), Some(&item_request.to_variant()));
|
||||
|
||||
main_history_closed.append_item(&menu_item);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue