Skip to content

Hardcoding of Image source #8107

Answered by Vadoola
john- asked this question in Q&A
Discussion options

You must be logged in to vote

Does this work if you do it like this? making the property an image instead of a string?

Main.slint

import { FunctionButton } from "function-button.slint";

export component AppWindow inherits Window {

    width:1024px;
    height: 576px;

    VerticalLayout {
        spacing: 10px;
        // alignment: center;
        x: 0px;
        y: 0px;
        width: 120px;
        height: parent.height;

        in property <[{label: string, image: image}]> model: [
            {label: "Telephone", image: @image-url("assets/Telephone.png") },
            {label: "Music", image: @image-url("assets/Music.png") },
        ];
        for data in model: FunctionButton {
            height: 120px;
   …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by john-
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants