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

IconImage is not the correct size and does not scale #555

Open
jmilloy opened this issue Aug 22, 2024 · 3 comments
Open

IconImage is not the correct size and does not scale #555

jmilloy opened this issue Aug 22, 2024 · 3 comments

Comments

@jmilloy
Copy link

jmilloy commented Aug 22, 2024

I am trying to use images in PushButton icons.

PushButton:
    icon = Icon(images=[IconImage(image=load_image('my_image.svg'))])

The image is displayed, but it is neither the size of the image nor does it scale with the PushButton size (as defined in constraints). I tried setting the raw_size and size for the Image but that had no affect. It is displayed very small, like 6x6, but the image in 64x64 and the PushButton is 96x100. I tried with both an svg and a png.

@jmilloy jmilloy changed the title svg IconImage is not the correct size and does not scale IconImage is not the correct size and does not scale Aug 22, 2024
@jmilloy
Copy link
Author

jmilloy commented Aug 26, 2024

I'm realizing that I can't figure out how to size the PushButton any other way than to add text and style the font_size. It seems to ignore height constraints. What am I missing about this?

@MatthieuDartiailh
Copy link
Member

Off the top of my head, a PushButton tend to stick to its natural size even if more space is available. Try playing with limit_width and feel free to check the other attributes available on ConstraintsWidget subclasses.

@sccolbert
Copy link
Member

sccolbert commented Aug 26, 2024 via email

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

No branches or pull requests

3 participants