Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Establish a single point in the Toolkit where a KryptonCustomPalette is assigned. #1623

Closed
giduac opened this issue Jul 11, 2024 · 4 comments
Labels
completed This issue has been completed. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. version:100 All things to do with V100.
Milestone

Comments

@giduac
Copy link
Contributor

giduac commented Jul 11, 2024

Is your feature request related to a problem? Please describe.
At the moment Theme Selector Controls have a property to set the Custom theme and it can also be done through the
ThemeManager and KryptonManager. If there are more locations where this can be done than those should be addressed as well.

If there are other points where this can occur, those should be named here.

Describe the solution you'd like
Consolidate this to a single point in the Toolkit where a custom theme will be assigned.

Describe alternatives you've considered
N/A

Approach

  • Setting a custom palette already can be done via KManager. That should suffice and be the default and only way.
  • Remove / migrate internal use of these methods and properties.
  • Old style methods and properties will be obsolete in V100 and removed in V110
@giduac giduac added enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. labels Jul 11, 2024
@PWagner1 PWagner1 added the version:100 All things to do with V100. label Jul 11, 2024
@PWagner1 PWagner1 added this to the Version 100 milestone Jul 11, 2024
@giduac giduac self-assigned this Oct 28, 2024
@giduac giduac added the under investigation This bug/issue is currently under investigation. label Oct 28, 2024
@giduac giduac pinned this issue Oct 28, 2024
@PWagner1
Copy link
Contributor

Added to list

@giduac
Copy link
Contributor Author

giduac commented Jan 17, 2025

@PWagner1

No, this hs nothing todo with 2021

@giduac
Copy link
Contributor Author

giduac commented Jan 18, 2025

@Smurf-IV & @PWagner1

This method in ThemeManager raises some questions.

  • The KryptonCustomPaletteBase palette param serves no purpose

I'd like to add an ApplyTheme method for this to the method group and rewrite this a bit.
Make this one Obsolete in V100 and remove in V110

        /// <summary>
        /// Loads the custom theme.
        /// </summary>
        /// <param name="palette">The palette.</param>
        /// <param name="manager">The manager.</param>
        /// <param name="themeFile">A custom theme file.</param>
        /// <param name="silent">if set to <c>true</c> [silent].</param>
        public static void LoadCustomTheme(KryptonCustomPaletteBase palette, KryptonManager manager, string themeFile = "", bool silent = false)
        {
            try
            {
                // Declare new instances (no need for locking if these are local to the method)
                palette = new KryptonCustomPaletteBase();
                manager = new KryptonManager();

                // TODO: Add silent option
                if (silent)
                {
                    if (themeFile is not ("" and ""))
                    {
                        palette.Import(themeFile, silent);
                    }
                }
                else
                {
                    palette.Import();
                }

                // Set manager
                manager.GlobalCustomPalette = palette;

                ApplyTheme(PaletteMode.Custom, manager);
            }
            catch (Exception exc)
            {
                KryptonExceptionHandler.CaptureException(exc,
                    showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
            }
        }

@PWagner1
Copy link
Contributor

@Smurf-IV & @PWagner1

This method in ThemeManager raises some questions.

  • The KryptonCustomPaletteBase palette param serves no purpose

I'd like to add an ApplyTheme method for this to the method group and rewrite this a bit. Make this one Obsolete in V100 and remove in V110

    /// <summary>
    /// Loads the custom theme.
    /// </summary>
    /// <param name="palette">The palette.</param>
    /// <param name="manager">The manager.</param>
    /// <param name="themeFile">A custom theme file.</param>
    /// <param name="silent">if set to <c>true</c> [silent].</param>
    public static void LoadCustomTheme(KryptonCustomPaletteBase palette, KryptonManager manager, string themeFile = "", bool silent = false)
    {
        try
        {
            // Declare new instances (no need for locking if these are local to the method)
            palette = new KryptonCustomPaletteBase();
            manager = new KryptonManager();

            // TODO: Add silent option
            if (silent)
            {
                if (themeFile is not ("" and ""))
                {
                    palette.Import(themeFile, silent);
                }
            }
            else
            {
                palette.Import();
            }

            // Set manager
            manager.GlobalCustomPalette = palette;

            ApplyTheme(PaletteMode.Custom, manager);
        }
        catch (Exception exc)
        {
            KryptonExceptionHandler.CaptureException(exc,
                showStackTrace: GlobalStaticValues.DEFAULT_USE_STACK_TRACE);
        }
    }```

@giduac

Go ahead, it'll likely not work when the bigger changes are implemented

@giduac giduac removed their assignment Jan 18, 2025
@giduac giduac added completed This issue has been completed. and removed under investigation This bug/issue is currently under investigation. labels Jan 18, 2025
@giduac giduac closed this as completed Jan 18, 2025
@PWagner1 PWagner1 unpinned this issue Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This issue has been completed. enhancement New feature or request new feature A new feature has been requested. suggestion A suggestion has been requested. version:100 All things to do with V100.
Projects
None yet
Development

No branches or pull requests

2 participants