mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
add page status enum
This commit is contained in:
parent
7587e02aff
commit
4b3ea84f39
1 changed files with 17 additions and 0 deletions
|
|
@ -1,14 +1,30 @@
|
||||||
use gtk::glib::GString;
|
use gtk::glib::GString;
|
||||||
|
|
||||||
|
// Page MIME type (not related with gemini status code)
|
||||||
|
// Useful for content renderer detection, etc
|
||||||
pub enum Mime {
|
pub enum Mime {
|
||||||
TextGemini,
|
TextGemini,
|
||||||
TextPlain,
|
TextPlain,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Internal page status (not related with gemini status code)
|
||||||
|
// Useful for widgets composition
|
||||||
|
pub enum Status {
|
||||||
|
Failure,
|
||||||
|
Redirect,
|
||||||
|
Success,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Meta {
|
pub struct Meta {
|
||||||
|
// Text meta data for page
|
||||||
|
// Useful to update window title, label text, etc
|
||||||
pub title: Option<GString>,
|
pub title: Option<GString>,
|
||||||
pub description: Option<GString>,
|
pub description: Option<GString>,
|
||||||
|
// Enums
|
||||||
pub mime: Option<Mime>,
|
pub mime: Option<Mime>,
|
||||||
|
pub status: Option<Status>,
|
||||||
|
// Useful to compose other widgets
|
||||||
|
// (e.g. navigation bar listen for this value update)
|
||||||
pub progress_fraction: f32,
|
pub progress_fraction: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -18,6 +34,7 @@ impl Meta {
|
||||||
title: None,
|
title: None,
|
||||||
description: None,
|
description: None,
|
||||||
mime: None,
|
mime: None,
|
||||||
|
status: None,
|
||||||
progress_fraction: 0.0,
|
progress_fraction: 0.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue