Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More refactoring for mutli components #5435

Merged
merged 2 commits into from
Jun 20, 2024
Merged

Conversation

ogoffart
Copy link
Member

No description provided.

@ogoffart ogoffart requested a review from tronical June 19, 2024 13:54
@@ -271,32 +271,22 @@ pub fn eval_expression(expression: &Expression, local_context: &mut EvalLocalCon
Ok(Default::default())
}
i_slint_compiler::expression_tree::ImageReference::AbsolutePath(path) => {
corelib::graphics::Image::load_from_path(std::path::Path::new(path))
}
i_slint_compiler::expression_tree::ImageReference::EmbeddedData { resource_id, extension } => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was unused? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used for builtin image (we were using EmbedResourcesKind::OnlyBuiltinResources before) I changed it to a new EmbedResourcesKind::Nothing so nothing gets "embedded".
Notice that the embedded pass does not anyway embed anything, it just means that the rust/cpp compiler will do that later. It just create resource_id which we need to map.
Since we just re-use the resource_id to get to the path (so do the inverse of the embedd_resource pass) we can just not do it, and simplify the code.

pub async fn lower_layouts(
pub fn lower_layouts(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

Preparation for multi-components

Note that this had to rename one instance of TextStyle because it
conflicts with the struct of the same name used in the FontSettings
in the style. This wasn't a problem before because it shares some
property in common, and the the order of processing of component has
changed leading to the other one being generated.
(But that is a wider bug in the compiler outside of the scope of this
refactoring)
@ogoffart ogoffart merged commit a4c0cc9 into master Jun 20, 2024
36 checks passed
@ogoffart ogoffart deleted the olivier/multi-components branch June 20, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants