mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
draft images support
This commit is contained in:
parent
44c68675b2
commit
5415b7e212
2 changed files with 6 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ use status::Status;
|
||||||
use text::Text;
|
use text::Text;
|
||||||
|
|
||||||
use gtk::{
|
use gtk::{
|
||||||
|
gdk_pixbuf::Pixbuf,
|
||||||
gio::SimpleAction,
|
gio::SimpleAction,
|
||||||
glib::{GString, Uri},
|
glib::{GString, Uri},
|
||||||
prelude::{BoxExt, WidgetExt},
|
prelude::{BoxExt, WidgetExt},
|
||||||
|
|
@ -34,10 +35,10 @@ impl Content {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
pub fn set_image(&self) {
|
pub fn set_image(&self, buffer: &Pixbuf) {
|
||||||
self.clean();
|
self.clean();
|
||||||
|
|
||||||
let image = Image::new();
|
let image = Image::new_from_pixbuf(buffer);
|
||||||
|
|
||||||
self.gobject.append(image.gobject());
|
self.gobject.append(image.gobject());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use gtk::Picture;
|
use gtk::{gdk_pixbuf::Pixbuf, Picture};
|
||||||
|
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
gobject: Picture,
|
gobject: Picture,
|
||||||
|
|
@ -6,9 +6,9 @@ pub struct Image {
|
||||||
|
|
||||||
impl Image {
|
impl Image {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new() -> Self {
|
pub fn new_from_pixbuf(buffer: &Pixbuf) -> Self {
|
||||||
Self {
|
Self {
|
||||||
gobject: Picture::new(),
|
gobject: Picture::for_pixbuf(buffer),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue