mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Add support for mapping image properties
This exposes a slint.Image class, which has a load_from_path class method as well as size/width/height properties. cc #4202
This commit is contained in:
parent
9aa931f1f8
commit
93efd74e24
6 changed files with 97 additions and 3 deletions
|
@ -86,3 +86,17 @@ impl From<slint_interpreter::SetCallbackError> for PySetCallbackError {
|
|||
Self(err)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PyLoadImageError(pub slint_interpreter::LoadImageError);
|
||||
|
||||
impl From<PyLoadImageError> for PyErr {
|
||||
fn from(err: PyLoadImageError) -> Self {
|
||||
pyo3::exceptions::PyRuntimeError::new_err(err.0.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<slint_interpreter::LoadImageError> for PyLoadImageError {
|
||||
fn from(err: slint_interpreter::LoadImageError) -> Self {
|
||||
Self(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue