Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor 2022 - Different Icon for dark theme

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
yan.gauthier
583 Views, 2 Replies

Inventor 2022 - Different Icon for dark theme

Is there a way to specify an icon for light theme and a different one for dark theme just like we can do for big and small icon ? Otherwise, does this mean the only way to adapt my icons is to check ThisApplication.ThemeManager.ActiveTheme.Name every time the events ApplicationEvents.OnApplicationOptionChange is fired ?

 

Tags (3)
2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: yan.gauthier

As far as I know, there is no special property for dar/light themes. But I guess that your alternative is a good solution and not that difficult to implement.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3
yan.gauthier
in reply to: JelteDeJong

To those interested. Here is the code I used to make it work (I work with C#, since VB.NET is a dying species)

 

private string activeTheme;
private void ApplicationEvents_OnApplicationOptionChange(EventTimingEnum BeforeOrAfter, NameValueMap Context, out HandlingCodeEnum HandlingCode)
        {
            if(BeforeOrAfter == EventTimingEnum.kBefore)
            {
                activeTheme = InvApp.ThemeManager.ActiveTheme.Name;
            }
            else if(BeforeOrAfter == EventTimingEnum.kAfter)
            {
                if (activeTheme.Equals("DarkTheme", StringComparison.OrdinalIgnoreCase) && InvApp.ThemeManager.ActiveTheme.Name.Equals("LightTheme", StringComparison.OrdinalIgnoreCase))
                {
                    SetDarkThemeIcons();
                }
                else if (activeTheme.Equals("LightTheme", StringComparison.OrdinalIgnoreCase) && InvApp.ThemeManager.ActiveTheme.Name.Equals("DarkTheme", StringComparison.OrdinalIgnoreCase))
                {
                    SetLightThemeIcons();
                }
            }

            HandlingCode = HandlingCodeEnum.kEventNotHandled; //let Inventor do its thing
        }

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report