mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
implement navigation callback
This commit is contained in:
parent
454ebe0170
commit
8ddd90bb11
3 changed files with 140 additions and 93 deletions
|
|
@ -1,12 +1,24 @@
|
|||
use gtk::{gio::File, prelude::FileExt};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct Directory {
|
||||
pub file: File,
|
||||
}
|
||||
|
||||
impl Directory {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
page.content.to_directory(&self.file);
|
||||
pub fn handle(&self, page: &Rc<super::Page>) {
|
||||
page.content.to_directory(&self.file, {
|
||||
let page = page.clone();
|
||||
move |file| {
|
||||
page.item_action.load.activate(
|
||||
Some(&format!(
|
||||
"file://{}",
|
||||
file.path().unwrap().to_str().unwrap()
|
||||
)),
|
||||
true,
|
||||
)
|
||||
}
|
||||
});
|
||||
page.set_title(&self.file.parse_name());
|
||||
page.set_progress(0.0);
|
||||
page.window_action.find.simple_action.set_enabled(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue