weclaw1 / image-roll

Image Roll - simple and fast GTK image viewer with basic image manipulation tools. Written in Rust.
MIT License
185 stars 10 forks source link

Make feature "Set image as a wallpaper" optional #43

Closed jirutka closed 2 years ago

jirutka commented 2 years ago

This single feature depends on the ashpd crate which is a pretty huge dependency - it adds 61 transitive dependencies and doubles the size of the image-roll binary. Moreover, this feature is usable only on some desktops. For example, Sway users will not benefit from it.

This commit introduces a (cargo) feature named "wallpaper", which is enabled by default. When the application is built with --no-default-features, the ashpd dependency is excluded from the dependency tree and the "Set as wallpaper" button is disabled (by setting sensitive to false).

This is suboptiomal, ideally I'd like to remove the button from the UI when this feature is disabled, but I don't know how to do it without adding too much complexity.

weclaw1 commented 2 years ago

Looks good! In the future I want to move to relm4 with UI as code, which will make things such as removing the button during runtime easy.