Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to generate a responsive Image? #2607

Closed
Berrysoft opened this issue Apr 20, 2023 · 1 comment
Closed

How to generate a responsive Image? #2607

Berrysoft opened this issue Apr 20, 2023 · 1 comment

Comments

@Berrysoft
Copy link
Contributor

I would like to generate a image which is reponsive to the avaliable size. For example, the layout is

VerticalBox {
    Image {
        // Need source here.
    }
    Button {
        text: "Some other functionalities";
    }
}

I would like the Image widget occupy all remaining spaces, and generate an bitmap (e.g. a plot from plotters).

My questions are the following:

  • How to know the remaining spaces in a VerticalBox?
  • How to response the resize event of the window?
  • Or, how to response the redraw event of the Image widget?

Either the solutions below is OK, I think:

@Berrysoft
Copy link
Contributor Author

Specifically, for plots, there's another solution: enable Image to load SVG from memory.

@slint-ui slint-ui locked and limited conversation to collaborators Apr 21, 2023
@ogoffart ogoffart converted this issue into discussion #2611 Apr 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant