From 6a2a1f2f51dd4169e95b3c50a0790f7d727db3ee Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 09:26:04 +0100 Subject: [PATCH 1/6] * Updates --- README.md | 2 ++ .../Controls Toolkit/KryptonForm.cs | 16 ++++++++++++++++ .../Controls Toolkit/KryptonPalette.cs | 14 +++++++------- .../Converters/PaletteModeConverter.cs | 7 +++++-- .../Palette Base/PaletteDefinitions.cs | 2 ++ 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 755955c24..61a239501 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) +* New, you can now alter a `KryptonManager` and a `KryptonPalette` from within a `KryptonForm` itself +* 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..ded3fb61b 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 @@ -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 InternalKryptonManager { get => _internalKryptonManager; private set => _internalKryptonManager = value; } + + /// Gets the internal krypton palette. + /// The internal krypton palette. + [Description("Create a custom theme palette.")] + public KryptonPalette InternalKryptonPalette { get => _internalKryptonPalette; private set => _internalKryptonPalette = value; } #endregion #region Public Chrome 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..45be7ab0c 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,9 @@ 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.V + }; #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..5e1bb3ea0 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs @@ -2276,6 +2276,8 @@ public enum PaletteModeManager /// SparklePurple, + VisualStudio2019, + /// /// Specifies a custom palette be used. /// From 0f677ec5ba7b20ebcc0ccb29faea09019c223b15 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 09:42:39 +0100 Subject: [PATCH 2/6] * Updates --- .../Converters/PaletteModeConverter.cs | 5 +++-- .../Palette Base/PaletteDefinitions.cs | 20 ++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs index 45be7ab0c..8b9fa86df 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Converters/PaletteModeConverter.cs @@ -38,8 +38,9 @@ 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.V + new(PaletteMode.SparklePurple, "Sparkle - Purple"), + //new(PaletteMode.VisualStudioDark, "Visual Studio Dark"), + //new(PaletteMode.VisualStudioLight, "Visual Studio Light") }; #endregion diff --git a/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs b/Source/Krypton Components/Krypton.Toolkit/Palette Base/PaletteDefinitions.cs index 5e1bb3ea0..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,7 +2286,15 @@ public enum PaletteModeManager /// SparklePurple, - VisualStudio2019, + /// + /// Specifies the visual studio dark palette theme. + /// + VisualStudioDark, + + /// + /// Specifies the visual studio light palette theme. + /// + VisualStudioLight, /// /// Specifies a custom palette be used. From 62a7a68c6c7fd3a391e0e56b7614a7114e767270 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 09:52:16 +0100 Subject: [PATCH 3/6] * Updates --- ...aletteVisualStudio2019Base.cs => PaletteVisualStudioBase.cs} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Source/Krypton Components/Krypton.Toolkit/Palette Builtin/{PaletteVisualStudio2019Base.cs => PaletteVisualStudioBase.cs} (99%) 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); From 30a1a72d70674b49d07cae270b72163160e7f94a Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 18:40:41 +0100 Subject: [PATCH 4/6] * Alterations --- .../Krypton.Toolkit/Controls Toolkit/KryptonForm.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs index ded3fb61b..9f93c3058 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonForm.cs @@ -181,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; @@ -634,12 +634,12 @@ public Control ActiveControl /// Gets the internal krypton manager. /// The internal krypton manager. [Description("Manages the current theme.")] - public KryptonManager InternalKryptonManager { get => _internalKryptonManager; private set => _internalKryptonManager = value; } + 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 InternalKryptonPalette { get => _internalKryptonPalette; private set => _internalKryptonPalette = value; } + public KryptonPalette KryptonPalette { get => _internalKryptonPalette; private set => _internalKryptonPalette = value; } #endregion #region Public Chrome From 7dc6266631b0c286f54ddae996135c144483eda3 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 18:50:06 +0100 Subject: [PATCH 5/6] Update KryptonInputBox.cs --- .../Krypton.Toolkit/Controls Toolkit/KryptonInputBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)] From e97a3bdbc75ac053d16b6b7f1aea1322450e49a0 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Wed, 9 Jun 2021 19:33:22 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61a239501..7c656725b 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ These packages only support .NET Framework >= 4.5, .NET Core 3.1 and .NET 6. ======= ## 2021-08-01 Build 2108 - August 2021 (Canary) -* New, you can now alter a `KryptonManager` and a `KryptonPalette` from within a `KryptonForm` itself +* 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