mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
draft image controller
This commit is contained in:
parent
52e7e0359f
commit
deafe0845d
4 changed files with 63 additions and 1 deletions
|
|
@ -1,7 +1,8 @@
|
|||
// @TODO mod image;
|
||||
mod image;
|
||||
mod status;
|
||||
mod text;
|
||||
|
||||
use image::Image;
|
||||
use status::Status;
|
||||
use text::Text;
|
||||
|
||||
|
|
@ -33,6 +34,14 @@ impl Content {
|
|||
}
|
||||
|
||||
// Actions
|
||||
pub fn set_image(&self) {
|
||||
self.clean();
|
||||
|
||||
let image = Image::new();
|
||||
|
||||
self.gobject.append(image.gobject());
|
||||
}
|
||||
|
||||
pub fn set_status_failure(&self, title: &str, description: &str) {
|
||||
self.clean();
|
||||
|
||||
|
|
|
|||
19
src/app/browser/window/tab/item/page/content/image.rs
Normal file
19
src/app/browser/window/tab/item/page/content/image.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use gtk::Picture;
|
||||
|
||||
pub struct Image {
|
||||
gobject: Picture,
|
||||
}
|
||||
|
||||
impl Image {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
gobject: Picture::new(),
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
pub fn gobject(&self) -> &Picture {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,10 @@ use gtk::glib::GString;
|
|||
pub enum Mime {
|
||||
TextGemini,
|
||||
TextPlain,
|
||||
ImagePng,
|
||||
ImageGif,
|
||||
ImageJpeg,
|
||||
ImageWebp,
|
||||
}
|
||||
|
||||
// Internal page status (not related with gemini status code)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue