From d8dd136994616971fff23c9df6caf65257a31e10 Mon Sep 17 00:00:00 2001 From: Smurf-iv Date: Sat, 21 Jan 2023 09:05:27 +0000 Subject: [PATCH 1/2] - Rename `KryptonPalette` to `KryptonCustomPaletteBase` to make it obvious what it is. - Add designer code to allow the `KryptonThemeComboBox` to add a `KryptonCustomPalette` #827 --- ...ryptonPalette.cs => KryptonCustomPaletteBase.cs} | 2 +- .../Controls Toolkit/KryptonThemeComboBox.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) rename Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/{KryptonPalette.cs => KryptonCustomPaletteBase.cs} (99%) diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs similarity index 99% rename from Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs rename to Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs index f7fa1956a..ee5411014 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonPalette.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs @@ -2704,7 +2704,7 @@ public IRenderer BaseRenderer protected override void DefineFonts() { - throw new NotImplementedException(); + // This class has no font fields } /// diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs index c38b3f88e..143508d3d 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonThemeComboBox.cs @@ -48,6 +48,13 @@ public int ThemeSelectedIndex private bool ShouldSerializeThemeSelectedIndex() => _selectedIndex != 25; + /// + /// Gets and sets the ThemeSelectedIndex. + /// + [Category(@"Visuals")] + [Description(@"Custom Theme to use when `Custom` is selected")] + [DefaultValue(null)] + public KryptonCustomPaletteBase KryptonCustomPalette { get; set; } [EditorBrowsable(EditorBrowsableState.Never)] public KryptonManager Manager @@ -98,6 +105,12 @@ protected override void OnSelectedIndexChanged(EventArgs e) ThemeSelectedIndex = SelectedIndex; base.OnSelectedIndexChanged(e); + if ((ThemeManager.GetThemeManagerMode(Text) == PaletteMode.Custom) + && (KryptonCustomPalette != null) + ) + { + Manager.GlobalPalette = KryptonCustomPalette; + } } #endregion From e4d8736eb29581d70c5ebea26ab703dce59a7493 Mon Sep 17 00:00:00 2001 From: Smurf-iv Date: Sat, 21 Jan 2023 09:26:45 +0000 Subject: [PATCH 2/2] - And the Changelog --- Documents/Help/Changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index b7f15a7c7..1a050048f 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -5,6 +5,7 @@ ======= ## 2023-11-xx - Build 2311 - November 2023 +* Complete [#827](https://github.com/Krypton-Suite/Standard-Toolkit/issues/827),Expose IPalette / PaletteBase as a public interface in KryptonManager * Fixed the display of the initial selected theme in the "ThemeSelection ComboBox" * Resolved [#876](https://github.com/Krypton-Suite/Standard-Toolkit/issues/876), `Office 365 - Black` does not display text correctly * Resolved [#874](https://github.com/Krypton-Suite/Standard-Toolkit/issues/874), 80.xx Canary Nuget text is incorrrect