mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
draft status pages
This commit is contained in:
parent
2d750d0572
commit
db3c5366fd
5 changed files with 87 additions and 50 deletions
23
src/app/browser/window/tab/item/page/content/status.rs
Normal file
23
src/app/browser/window/tab/item/page/content/status.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
mod error;
|
||||
|
||||
use error::Error;
|
||||
|
||||
use adw::StatusPage;
|
||||
|
||||
pub struct Status {
|
||||
gobject: StatusPage,
|
||||
}
|
||||
|
||||
impl Status {
|
||||
// Construct
|
||||
pub fn new_error(title: &str, description: &str) -> Self {
|
||||
Self {
|
||||
gobject: Error::new(title, description),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &StatusPage {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
15
src/app/browser/window/tab/item/page/content/status/error.rs
Normal file
15
src/app/browser/window/tab/item/page/content/status/error.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use adw::StatusPage;
|
||||
|
||||
pub struct Error {
|
||||
gobject: StatusPage,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
pub fn new(title: &str, description: &str) -> StatusPage {
|
||||
StatusPage::builder()
|
||||
.description(description)
|
||||
.icon_name("dialog-error-symbolic")
|
||||
.title(title)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ pub struct Meta {
|
|||
|
||||
pub struct Text {
|
||||
meta: Meta,
|
||||
widget: ScrolledWindow,
|
||||
gobject: ScrolledWindow,
|
||||
}
|
||||
|
||||
impl Text {
|
||||
|
|
@ -35,13 +35,13 @@ impl Text {
|
|||
title: gemini.reader_title().clone(),
|
||||
};
|
||||
|
||||
// Init widget
|
||||
let widget = ScrolledWindow::builder().build();
|
||||
// Init gobject
|
||||
let gobject = ScrolledWindow::builder().build();
|
||||
|
||||
widget.set_child(Some(gemini.gobject()));
|
||||
gobject.set_child(Some(gemini.gobject()));
|
||||
|
||||
// Result
|
||||
Self { meta, widget }
|
||||
Self { meta, gobject }
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
@ -49,7 +49,7 @@ impl Text {
|
|||
&self.meta.title
|
||||
}
|
||||
|
||||
pub fn widget(&self) -> &ScrolledWindow {
|
||||
&self.widget
|
||||
pub fn gobject(&self) -> &ScrolledWindow {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue