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

feat: add fill-svg and preserve-aspect-ratio attributes to image widget #1148

Merged
merged 3 commits into from
Aug 24, 2024

Conversation

w-lfchen
Copy link
Contributor

@w-lfchen w-lfchen commented Aug 8, 2024

Description

Usage

(image
  :fill-svg "#cba6f7"
  :image-height 200
  :image-width 400
  :preserve-aspect-ratio true
  :path "../github-icon.svg"
)

Showcase

see #1146, @hypernova7 has provided screenshots.

Additional Notes

preserve-aspect-ratio only sets a flag when loading the image and is therefore bound by what gtk allows.
for example, it doesn't work with svg images, but there are no issues with pngs

Checklist

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
    this shouldn't be necessary, since everything is generated automatically, right?
  • I used cargo fmt to automatically format all code before committing

@w-lfchen w-lfchen changed the title Feat/image feat(image): add fill-svg and preserve-aspect-ratio attributes Aug 8, 2024
@w-lfchen w-lfchen changed the title feat(image): add fill-svg and preserve-aspect-ratio attributes feat: add fill-svg and preserve-aspect-ratio attributes to image widget Aug 8, 2024
@elkowar elkowar merged commit 5212e62 into elkowar:master Aug 24, 2024
1 check passed
@w-lfchen w-lfchen deleted the feat/image branch August 24, 2024 11:07
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.

2 participants