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

Can I stretch an Icon? #40

Open
alessandrofrancesconi opened this issue Jan 23, 2025 · 1 comment
Open

Can I stretch an Icon? #40

alessandrofrancesconi opened this issue Jan 23, 2025 · 1 comment

Comments

@alessandrofrancesconi
Copy link

Is there a way to stretch an Icon to make it bigger in only one dimension?

If I try to make it 30x80 as below, it only enlarges the bounding box but the icon remains squared and centered

<MaterialIcon Kind="SubdirectoryArrowRight" VerticalAlignment="Stretch" Width="30" Height="80" Background="Red" />

Image

@SKProCH
Copy link
Owner

SKProCH commented Jan 23, 2025

Hello, @alessandrofrancesconi

This can be achieved via style in Avalonia (and probably overriding a control theme in other frameworks):

<Style Selector="avalonia|MaterialIcon /template/ Viewbox">
    <Setter Property="Stretch" Value="Fill" />
</Style>

Does it solve your problem?

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

2 participants