mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
handle directory route errors, use referenced Page argument, remove extra Rc ns dependencies
This commit is contained in:
parent
bcf4f44cfb
commit
2a1f4a89ac
4 changed files with 47 additions and 61 deletions
|
|
@ -1,6 +1,4 @@
|
|||
use super::Page;
|
||||
use gtk::{gdk::Texture, glib::Uri};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub enum Image {
|
||||
Bitmap(Uri, Texture),
|
||||
|
|
@ -8,7 +6,7 @@ pub enum Image {
|
|||
}
|
||||
|
||||
impl Image {
|
||||
pub fn handle(&self, page: Rc<Page>) {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
let uri = match self {
|
||||
Self::Bitmap(uri, texture) => {
|
||||
page.content.to_image(texture);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
use super::Page;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub enum Status {
|
||||
Failure(String),
|
||||
}
|
||||
|
||||
impl Status {
|
||||
pub fn handle(&self, page: Rc<Page>) {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
let (message, widget) = match self {
|
||||
Self::Failure(message) => (message, page.content.to_status_failure()),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
use super::Page;
|
||||
use gtk::glib::Uri;
|
||||
use std::rc::Rc;
|
||||
|
||||
pub enum Text {
|
||||
Gemini(Uri, String),
|
||||
|
|
@ -9,7 +7,7 @@ pub enum Text {
|
|||
}
|
||||
|
||||
impl Text {
|
||||
pub fn handle(&self, page: Rc<Page>) {
|
||||
pub fn handle(&self, page: &super::Page) {
|
||||
let (uri, widget) = match self {
|
||||
Self::Gemini(uri, data) => (uri, page.content.to_text_gemini(uri, data)),
|
||||
Self::Plain(uri, data) => (uri, page.content.to_text_plain(data)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue