Fix data section placement for pre-compiled textures in C++

Place pre-rendered textures into read-only data, instead of the data
section.

Amends 3db168d03d
This commit is contained in:
Simon Hausmann 2023-08-23 16:25:30 +02:00 committed by Simon Hausmann
parent 2acf687cf3
commit 21d44e3a31

View file

@ -569,7 +569,7 @@ pub fn generate(doc: &Document) -> impl std::fmt::Display {
let data = data.iter().map(ToString::to_string).join(", ");
let data_name = format!("slint_embedded_resource_{}_data", er.id);
file.declarations.push(Declaration::Var(Var {
ty: "inline uint8_t".into(),
ty: "inline const uint8_t".into(),
name: data_name.clone(),
array_size: Some(count),
init: Some(format!("{{ {data} }}")),