init memory index

This commit is contained in:
yggverse 2024-09-30 18:02:52 +03:00
parent 3f5b4f9dfa
commit fceb3a75a4

View File

@ -4,13 +4,23 @@ mod forward;
use back::Back; use back::Back;
use forward::Forward; use forward::Forward;
use gtk::{gio::SimpleAction, prelude::BoxExt, Box, Orientation}; use gtk::{gio::SimpleAction, glib::GString, prelude::BoxExt, Box, Orientation};
use std::sync::Arc; use std::{cell::RefCell, sync::Arc};
struct Memory {
request: GString,
time: i32, // @TODO
}
pub struct History { pub struct History {
widget: Box, // Components
back: Back, back: Back,
forward: Forward, forward: Forward,
// Extras
memory: Vec<Memory>,
index: RefCell<i32>,
// GTK
widget: Box,
} }
impl History { impl History {
@ -34,10 +44,21 @@ impl History {
widget.append(back.widget()); widget.append(back.widget());
widget.append(forward.widget()); widget.append(forward.widget());
// Init memory
let memory = Vec::new();
// Init index
let index = RefCell::new(-1);
Self { Self {
widget, // Actions
back, back,
forward, forward,
// Extras
memory,
index,
// GTK
widget,
} }
} }