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:
Simon Hausmann 2024-02-06 11:52:28 +01:00 committed by Simon Hausmann
parent 9aa931f1f8
commit 93efd74e24
6 changed files with 97 additions and 3 deletions

View file

@ -1,6 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
mod image;
mod interpreter;
use interpreter::{ComponentCompiler, PyDiagnostic, PyDiagnosticLevel, PyValueType};
mod errors;
@ -28,6 +29,7 @@ fn slint(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
.map_err(|e| errors::PyPlatformError(e))?;
m.add_class::<ComponentCompiler>()?;
m.add_class::<image::PyImage>()?;
m.add_class::<PyValueType>()?;
m.add_class::<PyDiagnosticLevel>()?;
m.add_class::<PyDiagnostic>()?;