gtk/cell_renderer_pixbuf.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::CellRendererPixbuf;
4use crate::IconSize;
5use glib::object::{IsA, ObjectExt};
6use glib::translate::*;
7
8pub trait CellRendererPixbufExtManual:
9 IsA<CellRendererPixbuf> + IsA<glib::object::Object> + 'static
10{
11 /// The [`IconSize`][crate::IconSize] value that specifies the size of the rendered icon.
12 #[doc(alias = "get_property_stock_size")]
13 fn stock_size(&self) -> IconSize {
14 unsafe { from_glib(self.property::<u32>("stock-size") as i32) }
15 }
16
17 /// The [`IconSize`][crate::IconSize] value that specifies the size of the rendered icon.
18 fn set_stock_size(&self, stock_size: IconSize) {
19 self.set_property("stock-size", stock_size.into_glib() as u32);
20 }
21}
22
23impl<O: IsA<CellRendererPixbuf> + IsA<glib::object::Object>> CellRendererPixbufExtManual for O {}