mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
add horizontal margins for picture
This commit is contained in:
parent
9c54f0b294
commit
2b2cb50f28
@ -1,4 +1,6 @@
|
|||||||
use gtk::{gdk_pixbuf::Pixbuf, Picture};
|
use gtk::{gdk_pixbuf::Pixbuf, prelude::WidgetExt, Picture};
|
||||||
|
|
||||||
|
const MARGIN: i32 = 6;
|
||||||
|
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
gobject: Picture,
|
gobject: Picture,
|
||||||
@ -7,9 +9,12 @@ pub struct Image {
|
|||||||
impl Image {
|
impl Image {
|
||||||
// Construct
|
// Construct
|
||||||
pub fn new_from_pixbuf(buffer: &Pixbuf) -> Self {
|
pub fn new_from_pixbuf(buffer: &Pixbuf) -> Self {
|
||||||
Self {
|
let gobject = Picture::for_pixbuf(buffer);
|
||||||
gobject: Picture::for_pixbuf(buffer),
|
|
||||||
}
|
gobject.set_margin_end(MARGIN);
|
||||||
|
gobject.set_margin_start(MARGIN);
|
||||||
|
|
||||||
|
Self { gobject }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user