diff --git a/README.md b/README.md index 755955c24..7c656725b 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ These packages only support .NET Framework >= 4.5, .NET Core 3.1 and .NET 6. ======= ## 2021-08-01 Build 2108 - August 2021 (Canary) +* Implement [#154](https://github.com/Krypton-Suite/Standard-Toolkit/issues/154), Ability to alter both a `KryptonManager` and a `KryptonPalette` from within a `KryptonForm` +* Implement [#149](https://github.com/Krypton-Suite/Standard-Toolkit/issues/149), Change the default theme from `Office 2010 - Blue` to `Office 365 - Blue` * Implement [#147](https://github.com/Krypton-Suite/Standard-Toolkit/issues/147), Update `csproj` files to handle `AssemblyInfo` data * New `KryptonInputBoxManager` control, now you can configure a `KryptonInputBox` through the designer * Improved the `KryptonInputBox` to take advantage of the `KryptonTextBox` ***CueHint*** features diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs index 1a0bbf255..9f93c3058 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs @@ -98,6 +98,8 @@ public FormFixedButtonSpecCollection(KryptonForm owner) private Icon _cacheIcon; private int _cornerRoundingRadius; private Control _activeControl; + private KryptonManager _internalKryptonManager; + private KryptonPalette _internalKryptonPalette; #endregion #region Identity @@ -179,7 +181,7 @@ public KryptonForm() ToolTipManager.CancelToolTip += OnCancelToolTip; _buttonManager.ToolTipManager = ToolTipManager; - // Hook into globalstatic events + // Hook into global static events KryptonManager.GlobalAllowFormChromeChanged += OnGlobalAllowFormChromeChanged; KryptonManager.GlobalPaletteChanged += OnGlobalPaletteChanged; @@ -201,6 +203,10 @@ public KryptonForm() // Set the CornerRoundingRadius to '-1', default value CornerRoundingRadius = -1; + + _internalKryptonManager = new KryptonManager(); + + _internalKryptonPalette = new KryptonPalette(); } /// @@ -624,6 +630,16 @@ public Control ActiveControl } } } + + /// Gets the internal krypton manager. + /// The internal krypton manager. + [Description("Manages the current theme.")] + public KryptonManager KryptonManager { get => _internalKryptonManager; private set => _internalKryptonManager = value; } + + /// Gets the internal krypton palette. + /// The internal krypton palette. + [Description("Create a custom theme palette.")] + public KryptonPalette KryptonPalette { get => _internalKryptonPalette; private set => _internalKryptonPalette = value; } #endregion #region Public Chrome diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs index 06973ccab..8d11b93e8 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs @@ -15,7 +15,7 @@ namespace Krypton.Toolkit { - //// + /// /// Displays an input box for the user. /// [ToolboxItem(false)] diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs index 0eaed7b3f..29ccb4bdf 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs @@ -124,8 +124,8 @@ public KryptonPalette() _needTMSPaintDelegate = OnMenuToolStatusPaint; // Set the default palette/palette mode - _basePalette = KryptonManager.GetPaletteForMode(PaletteMode.Office2010Blue); - _basePaletteMode = PaletteMode.Office2010Blue; + _basePalette = KryptonManager.GetPaletteForMode(PaletteMode.Office365Blue); + _basePaletteMode = PaletteMode.Office365Blue; // Set the default renderer _baseRenderer = null; @@ -3076,7 +3076,7 @@ public void ResetCustomisedKryptonPaletteFilePath() [KryptonPersist(false, false)] [Category("Visuals")] [Description("Base palette used to inherit from.")] - [DefaultValue(typeof(PaletteMode), "Office2010Blue")] + [DefaultValue(typeof(PaletteMode), "Office365Blue")] public PaletteMode BasePaletteMode { get => _basePaletteMode; @@ -3134,7 +3134,7 @@ public PaletteMode BasePaletteMode private bool ShouldSerializeBasePaletteMode() { - return (BasePaletteMode != PaletteMode.Office2010Blue); + return (BasePaletteMode != PaletteMode.Office365Blue); } /// @@ -3142,7 +3142,7 @@ private bool ShouldSerializeBasePaletteMode() /// public void ResetBasePaletteMode() { - BasePaletteMode = PaletteMode.Office2010Blue; + BasePaletteMode = PaletteMode.Office365Blue; } /// @@ -3165,7 +3165,7 @@ public IPalette BasePalette IPalette tempPalette = _basePalette; // Find the new palette mode based on the incoming value - _basePaletteMode = (value == null) ? PaletteMode.Office2010Blue : PaletteMode.Custom; + _basePaletteMode = (value == null) ? PaletteMode.Office365Blue : PaletteMode.Custom; _basePalette = value; // If the new value creates a circular reference @@ -3209,7 +3209,7 @@ public IPalette BasePalette /// public void ResetBasePalette() { - BasePaletteMode = PaletteMode.Office2010Blue; + BasePaletteMode = PaletteMode.Office365Blue; } /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs index 4bb8b5b48..8b9fa86df 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs @@ -19,7 +19,8 @@ namespace Krypton.Toolkit /// internal class PaletteModeConverter : StringLookupConverter { - #region Static Fields + #region Static Fields + /// Converts the values into a human readable format. private Pair[] _pairs = new Pair[] { new(PaletteMode.ProfessionalSystem, "Professional - System"), new(PaletteMode.ProfessionalOffice2003,"Professional - Office 2003"), new(PaletteMode.Office2007Blue, "Office 2007 - Blue"), @@ -37,7 +38,10 @@ internal class PaletteModeConverter : StringLookupConverter new(PaletteMode.Office365White, "Office 365 - White"), new(PaletteMode.SparkleBlue, "Sparkle - Blue"), new(PaletteMode.SparkleOrange, "Sparkle - Orange"), - new(PaletteMode.SparklePurple, "Sparkle - Purple") }; + new(PaletteMode.SparklePurple, "Sparkle - Purple"), + //new(PaletteMode.VisualStudioDark, "Visual Studio Dark"), + //new(PaletteMode.VisualStudioLight, "Visual Studio Light") + }; #endregion #region Identity diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs index 572a54b08..7b1d8da5e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs @@ -2169,6 +2169,16 @@ public enum PaletteMode /// SparklePurple, + /// + /// Specifies the visual studio dark palette theme. + /// + VisualStudioDark, + + /// + /// Specifies the visual studio light palette theme. + /// + VisualStudioLight, + /// /// Specifies a custom palette be used. /// @@ -2276,6 +2286,16 @@ public enum PaletteModeManager /// SparklePurple, + /// + /// Specifies the visual studio dark palette theme. + /// + VisualStudioDark, + + /// + /// Specifies the visual studio light palette theme. + /// + VisualStudioLight, + /// /// Specifies a custom palette be used. /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudio2019Base.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs similarity index 99% rename from Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudio2019Base.cs rename to Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs index bb1b9dc45..7ec5f10fb 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudio2019Base.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Builtin/PaletteVisualStudioBase.cs @@ -19,7 +19,7 @@ namespace Krypton.Toolkit /// Provides a base for Visual Studio 2020 palettes. /// /// - public abstract class PaletteVisualStudio2020Base : PaletteBase + public abstract class PaletteVisualStudioBase : PaletteBase { #region Static Fields private static readonly Padding _contentPaddingGrid = new(2, 1, 2, 1);