mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
delegate status info to widget implementation
This commit is contained in:
parent
d752fe18fb
commit
549c3fd946
4 changed files with 14 additions and 24 deletions
|
|
@ -9,7 +9,7 @@ use gtk::gio::{Cancellable, File};
|
|||
use std::{rc::Rc, time::Duration};
|
||||
|
||||
pub struct Status {
|
||||
gobject: StatusPage,
|
||||
pub gobject: StatusPage,
|
||||
}
|
||||
|
||||
impl Status {
|
||||
|
|
@ -38,9 +38,9 @@ impl Status {
|
|||
/// Create new mime issue preset
|
||||
///
|
||||
/// Useful as placeholder widget for mime issue handlers
|
||||
pub fn new_mime() -> Self {
|
||||
pub fn new_mime(mime: &str) -> Self {
|
||||
Self {
|
||||
gobject: mime::new_gobject(),
|
||||
gobject: mime::new_gobject(mime),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
use adw::StatusPage;
|
||||
|
||||
const DEFAULT_TITLE: &str = "Oops";
|
||||
const DEFAULT_ICON_NAME: &str = "dialog-question-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 {
|
||||
pub fn new_gobject(mime: &str) -> StatusPage {
|
||||
StatusPage::builder()
|
||||
.title(DEFAULT_TITLE)
|
||||
.icon_name(DEFAULT_ICON_NAME)
|
||||
.title("Oops")
|
||||
.description(format!("Content type `{mime}` not supported!"))
|
||||
.icon_name("dialog-question-symbolic")
|
||||
.build()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue