mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
draft mime issue status page
This commit is contained in:
parent
80684e0316
commit
596589a2f4
@ -71,6 +71,16 @@ impl Content {
|
||||
status
|
||||
}
|
||||
|
||||
/// Set new `content::Status` component for `Self` with new `status::Mime` issue preset
|
||||
///
|
||||
/// * action removes previous children component from `Self`
|
||||
pub fn to_status_mime(&self) -> Status {
|
||||
self.clean();
|
||||
let status = Status::new_mime();
|
||||
self.gobject.append(status.gobject());
|
||||
status
|
||||
}
|
||||
|
||||
/// Set new `content::Status` component for `Self` with new `status::Identity` preset
|
||||
///
|
||||
/// * action removes previous children component from `Self`
|
||||
|
@ -2,6 +2,7 @@ pub mod download;
|
||||
mod failure;
|
||||
mod identity;
|
||||
mod loading;
|
||||
mod mime;
|
||||
|
||||
use adw::StatusPage;
|
||||
use gtk::gio::{Cancellable, File};
|
||||
@ -34,6 +35,15 @@ impl Status {
|
||||
}
|
||||
}
|
||||
|
||||
/// Create new mime issue preset
|
||||
///
|
||||
/// Useful as placeholder widget for mime issue handlers
|
||||
pub fn new_mime() -> Self {
|
||||
Self {
|
||||
gobject: mime::new_gobject(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create new identity preset
|
||||
///
|
||||
/// Useful as placeholder for 60 status code
|
||||
|
13
src/app/browser/window/tab/item/page/content/status/mime.rs
Normal file
13
src/app/browser/window/tab/item/page/content/status/mime.rs
Normal file
@ -0,0 +1,13 @@
|
||||
use adw::StatusPage;
|
||||
|
||||
const DEFAULT_TITLE: &str = "Oops";
|
||||
const DEFAULT_ICON_NAME: &str = "help-contents-symbolic";
|
||||
|
||||
/// Create new default `GObject` preset for mime issue
|
||||
/// [StatusPage](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.StatusPage.html)
|
||||
pub fn new_gobject() -> StatusPage {
|
||||
StatusPage::builder()
|
||||
.title(DEFAULT_TITLE)
|
||||
.icon_name(DEFAULT_ICON_NAME)
|
||||
.build()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user