mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-11 02:44:15 +00:00
init memory index
This commit is contained in:
parent
3f5b4f9dfa
commit
fceb3a75a4
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user