nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.52k stars 130 forks source link

SVGImageView addition #532

Open bburan opened 9 months ago

bburan commented 9 months ago

I currently have an implementation that uses RawWidget with QtSvgWidget to display a SVG image. I'm thinking about cleaning this up and contributing to Enaml. Would this be better implemented as an SVGImageView widget (as opposed to trying to add support for SVG images to ImageView? I'm guessing a separate SVGImageView is more appropriate since the characteristics of vector graphics are different from raster graphics. ?

Either case, the point is to get feedback before I implement this.

frmdstryr commented 9 months ago

Is there any difference in the usage?

bburan commented 9 months ago

After reviewing ImageView, there are a few minor differences that suggest making SVGImageView a separate widget. For example, scale_to_fit and allow_upscaling are not relevant for a SVG image. Plus, ImageView takes an instance of Image, which is very raster-oriented (e.g., raw_size, transform_mode, etc.).

MatthieuDartiailh commented 9 months ago

Your analysis makes sense. Would there be any sense to have a kind of abstraction over vector graphics ?