mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
update page info on local files browse
This commit is contained in:
parent
6a100c48ee
commit
2f68e80a83
5 changed files with 118 additions and 39 deletions
|
|
@ -14,7 +14,14 @@ impl Directory {
|
|||
// on ready
|
||||
{
|
||||
let page = page.clone();
|
||||
move || page.set_progress(0.0)
|
||||
move || {
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Build directory tree".to_string());
|
||||
page.set_progress(0.0)
|
||||
}
|
||||
},
|
||||
// on activate
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ pub enum Image {
|
|||
|
||||
impl Image {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Rendering".to_string());
|
||||
let uri = match self {
|
||||
Self::Bitmap(uri, texture) => {
|
||||
page.content.to_image(texture);
|
||||
|
|
@ -17,5 +22,10 @@ impl Image {
|
|||
page.set_progress(0.0);
|
||||
page.snap_history();
|
||||
page.window_action.find.simple_action.set_enabled(false);
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Rendered".to_string());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ pub enum Status {
|
|||
|
||||
impl Status {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Parsing".to_string());
|
||||
let (message, widget) = match self {
|
||||
Self::Failure(message) => (message, page.content.to_status_failure()),
|
||||
};
|
||||
|
|
@ -12,5 +17,10 @@ impl Status {
|
|||
page.set_progress(0.0);
|
||||
page.snap_history();
|
||||
page.window_action.find.simple_action.set_enabled(false);
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Parsed".to_string());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,20 @@ pub enum Text {
|
|||
|
||||
impl Text {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Parsing".to_string());
|
||||
let (uri, widget) = match self {
|
||||
Self::Gemini(uri, data) => (uri, page.content.to_text_gemini(uri, data)),
|
||||
Self::Gemini(uri, data) => (uri, {
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.set_mime(Some("text/gemini".to_string()));
|
||||
page.content.to_text_gemini(uri, data)
|
||||
}),
|
||||
Self::Plain(uri, data) => (uri, page.content.to_text_plain(data)),
|
||||
Self::Source(uri, data) => (uri, page.content.to_text_source(data)),
|
||||
};
|
||||
|
|
@ -21,5 +33,10 @@ impl Text {
|
|||
page.set_progress(0.0);
|
||||
page.snap_history();
|
||||
page.window_action.find.simple_action.set_enabled(true);
|
||||
page.navigation
|
||||
.request
|
||||
.info
|
||||
.borrow_mut()
|
||||
.add_event("Parsed".to_string());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue