mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
Fix C++ build
With ImageInner::StaticTextures (the variant) and StaticTextures (the struct), we need to disambiguate for the generated enum contructor functions. This is done by prefixing the enum variant with their name.
This commit is contained in:
parent
f1dae75d53
commit
583c7a1b80
4 changed files with 5 additions and 3 deletions
|
|
@ -227,6 +227,7 @@ fn gen_corelib(
|
|||
"slint_image_path",
|
||||
"SharedPixelBuffer",
|
||||
"SharedImageBuffer",
|
||||
"StaticTextures",
|
||||
],
|
||||
vec!["Color"],
|
||||
"slint_image_internal.h",
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ namespace slint {
|
|||
struct Image
|
||||
{
|
||||
public:
|
||||
Image() : data(Data::None()) { }
|
||||
Image() : data(Data::ImageInner_None()) { }
|
||||
|
||||
/// Load an image from an image file
|
||||
static Image load_from_path(const SharedString &file_path)
|
||||
{
|
||||
Image img;
|
||||
img.data = Data::AbsoluteFilePath(file_path);
|
||||
img.data = Data::ImageInner_AbsoluteFilePath(file_path);
|
||||
return img;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue