Skip to content

script_manager: use SVG for the start/stop button icons - #715

Open
andriiryzhkov wants to merge 1 commit into
darktable-org:masterfrom
andriiryzhkov:power_icon_svg
Open

script_manager: use SVG for the start/stop button icons#715
andriiryzhkov wants to merge 1 commit into
darktable-org:masterfrom
andriiryzhkov:power_icon_svg

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Contributor

path20.png and blank20.png are 20x21 bitmaps, so the start/stop buttons are upscaled and soft on a HiDPI screen and stay 20px whatever the interface font size is. power.svg and blank.svg render at whatever size darktable asks for.

The geometry comes from dtgtk_cairo_paint_switch() so the button reads as darktable's own switch icon. The viewBox carries a margin, since the Lua button sizes itself to its content and has no padding of its own. Stroke width was picked by eye: darktable's switch is drawn at a fixed device-pixel width, which an SVG cannot match at every scale.

The old PNGs are now unreferenced but left in place – happy to drop them here if preferred.

Needs darktable#22229. Without it gtk_image_new_from_file() hands back a 48x48 pixbuf for a 24px SVG on a scale-2 display and lays it out at 48 logical px, against the PNG's 20.

Written with AI assistance.

The power and blank icons were 20x21 PNGs, so they were upscaled and
soft on a HiDPI screen and stayed 20px whatever the interface font
size. As SVG they are rendered at whatever size is asked for.

Geometry is taken from dtgtk_cairo_paint_switch() so the button matches
darktable's own switch icon, with a margin inside the viewBox so the
symbol does not touch the button border.
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.

1 participant