Changing dark mode icon setting doesn't stick the first time

Any time I’m replacing an icon and want to change this setting I have to do it two times (and press OK in between each time and open the dialog again).

(Also, just noticed, if you’re changing the default icon on an existing toolbar, and want to change this setting, even the light side icon doesn’t get saved. You have to do that twice too.)

Reproduced. Thanks again @eobet, sorry for this mess. I’ll get that fixed up asap.
Ticket: https://mcneel.myjetbrains.com/youtrack/issue/RH-84375/Changing-Options-in-the-Button-Editor-doesnt-stick-the-first-time

1 Like

Hi :wave: just confirming if this is still being fixed, I don’t see the issue in the yt link above. However, I can confirm the recolor isn’t working in Rhino 8 SR15 (8.15.24352.13001)
svg_dark_mode_issue
svg_dark_mode_issue_2

Yes, sorry, it’s on my plate, :slight_smile:

1 Like

RH-84375 is fixed in Rhino 8 Service Release 17

Re-reading this thread and I read two issues in your post @bfrederick , the old recolour was causing a lot of weird bugs, there is a way to make the recolour work however.

If you open the SVG up in a text editor you can add fill-dark and/or stroke-dark as properties. If your icon is using fill="black" you would change this to fill="black" fill-dark="white"

1 Like

Thanks @CallumSykes that seems to work great! The only exception is the tab icon :man_shrugging: shown here:

For anyone who wants to modify a folder full of SVG files I made a commmand line utility you can use:

2 Likes

Thanks for the tool! I made a little one but didn’t publish anything yet, really glad this is working for you. You can of course choose any colour and even have elements that only show in dark mode and/or only show in light mode. So it should be more powerful than the uncontrollable auto-flipping behaviour.

I think I know why this is, it’s something I’m working on, I need to unify some backend SVG stuff and that might fix this.

1 Like

Another thing I’m noticing is that svgs won’t render in the toolbar if they’re larger than 48px x 48px. Given that there are many open source svg sources to download online and many sizes, I guess it might be worth making that clear somewhere in the docs that svgs should be max 48px x 48 px. Or handle replacing the width and height svg attribute values automatically in the editor upon loading. Having this new ability to customize icons via svg attributes is fantastic. Thanks!

Can you give me an example of an SVG like that? Are you importing them into the SVG Editor or adding manually to an RUI?

Here’s the file:
Layers.svg

This was happening when loading them into the SVG editor:

The SVG renders correctly at multiple scales in svgviewer.dev

<svg xmlns="http://www.w3.org/2000/svg" width="800px" height="800px" viewBox="0 0 64 64" fill="none" transform="matrix(1, 0, 0, 1, 0, 0)">

<g id="SVGRepo_bgCarrier" stroke-width="0" />

<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" />

<g id="SVGRepo_iconCarrier"> <g clip-path="url(#clip0_14_1944)"> <path stroke="#000000" stroke-dark="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M48.718 37.163L54.764 40.186C55.1344 40.3711 55.446 40.6556 55.6637 41.0078C55.8815 41.36 55.9968 41.7659 55.9968 42.18C55.9968 42.5941 55.8815 43 55.6637 43.3522C55.446 43.7044 55.1344 43.9889 54.764 44.174L33 55.062C32.6898 55.2182 32.3473 55.2995 32 55.2995C31.6527 55.2995 31.3102 55.2182 31 55.062L9.23601 44.174C8.86559 43.9889 8.55404 43.7044 8.33629 43.3522C8.11854 43 8.0032 42.5941 8.0032 42.18C8.0032 41.7659 8.11854 41.36 8.33629 41.0078C8.55404 40.6556 8.86559 40.3711 9.23601 40.186L15.282 37.163"/> <path stroke="#000000" stroke-dark="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M48.718 27.129L54.763 30.149C55.1334 30.3341 55.445 30.6186 55.6627 30.9708C55.8805 31.323 55.9958 31.7289 55.9958 32.143C55.9958 32.5571 55.8805 32.963 55.6627 33.3152C55.445 33.6674 55.1334 33.9519 54.763 34.137L48.718 37.16L33 45.029C32.6896 45.1846 32.3472 45.2655 32 45.2655C31.6528 45.2655 31.3104 45.1846 31 45.029L15.28 37.163L9.235 34.14C8.86458 33.9549 8.55303 33.6704 8.33528 33.3182C8.11753 32.966 8.0022 32.5601 8.0022 32.146C8.0022 31.7319 8.11753 31.326 8.33528 30.9738C8.55303 30.6216 8.86458 30.3371 9.235 30.152L15.28 27.129"/> <path stroke="#000000" stroke-dark="#ffffff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" d="M31 9.235L9.23299 20.12C8.86262 20.3052 8.55113 20.5899 8.33343 20.9422C8.11573 21.2945 8.00043 21.7004 8.00043 22.1145C8.00043 22.5286 8.11573 22.9345 8.33343 23.2868C8.55113 23.6391 8.86262 23.9238 9.23299 24.109L31 34.994C31.3097 35.1489 31.6512 35.2295 31.9975 35.2295C32.3438 35.2295 32.6853 35.1489 32.995 34.994L54.767 24.109C55.1374 23.9238 55.4489 23.6391 55.6666 23.2868C55.8843 22.9345 55.9996 22.5286 55.9996 22.1145C55.9996 21.7004 55.8843 21.2945 55.6666 20.9422C55.4489 20.5899 55.1374 20.3052 54.767 20.12L33 9.235C32.6897 9.07914 32.3472 8.99797 32 8.99797C31.6527 8.99797 31.3103 9.07914 31 9.235Z"/> </g> <defs> <clipPath id="clip0_14_1944"> <rect fill="white" fill-dark="black" width="51.999" height="50.298" transform="translate(6 7)"/> </clipPath> </defs> </g>

</svg>

Changing the width height attributes to max 48px works:

 width="48px" height="48px" 

Yep. I see this. It’s supposed to strip out the height/width so it defaults to 100% x 100%.
Good find @bfrederick, thanks for this, fixing this will prevent some other bugs too!

YT : https://mcneel.myjetbrains.com/youtrack/issue/RH-86126/SVG-does-not-have-a-preview

1 Like

RH-86126 is fixed in Rhino 8 Service Release 18 Release Candidate

1 Like