Conversation
…g a custom theme # PR Description - #3183 ## Summary Fix a rendering artifact (a small square) appearing next to the `KryptonForm` Close (X) button when using a custom XML-based Krypton theme/palette. ## Root Cause When importing a custom palette from XML, palette values that are omitted by the theme XML could remain at placeholder/default C# values instead of being initialized from the palette's `BasePalette`. This could leave caption/button chrome in an invalid/partial state, producing a small stray visual element. ## Changes In `KryptonCustomPaletteBase.ImportFromXmlDocument`, the palette is now populated from `BasePalette` before applying the XML overrides: - Call `PopulateFromBaseOperation(null)` before importing the `Properties` / `Images` elements from the XML. ## Why this works The initial populate step ensures missing metrics/draw settings (including caption/button related values used by the form window buttons) are correctly inherited from the base palette. The subsequent XML import can then override only what the theme explicitly defines. ## Files Modified - `Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.cs` ## Testing - Repro: apply a custom theme (e.g. `Microsoft365Pink`) to a `KryptonForm` and verify the small square near the Close button is gone. - Sanity: verify built-in palettes are unaffected. ## Notes - A full `dotnet build` was not clean in this environment due to pre-existing MSBuild/resource configuration errors unrelated to this palette change.
…e-button-on-kryptonform-when-using-a-custom-theme
…kryptonform-when-using-a-custom-theme' of https://github.com/Krypton-Suite/Standard-Toolkit into 3183-bug-small-square-rendered-next-to-close-button-on-kryptonform-when-using-a-custom-theme
…kryptonform-when-using-a-custom-theme' of https://github.com/Krypton-Suite/Standard-Toolkit into 3183-bug-small-square-rendered-next-to-close-button-on-kryptonform-when-using-a-custom-theme
|
Hi @PWagner1, The issue is still present.
|
Hi @mcpbcs Thanks for the info, there's only one way to find out and that is to test that theory. |
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme
|
Okay, I will test it |
…kryptonform-when-using-a-custom-theme' of https://github.com/Krypton-Suite/Standard-Toolkit into 3183-bug-small-square-rendered-next-to-close-button-on-kryptonform-when-using-a-custom-theme
…deserialized in exported XML This commit fixes an issue where Font properties with no explicit value (Font == null) were not being correctly handled during XML export and import. Null Font values are now explicitly serialized using the "(none)" sentinel and correctly restored back to null during import, avoiding ambiguous or unintended default Font creation. Changes are limited to: - ExportObjectToElement - ImportObjectFromElement Fixes #3164
…ialized/deserialized in exported XML" This reverts commit d486f4f.
…deserialized in exported XML This commit fixes an issue where Font properties with no explicit value (Font == null) were not being correctly handled during XML export and import. Null Font values are now explicitly serialized using the "(none)" sentinel and correctly restored back to null during import, avoiding ambiguous or unintended default Font creation. Changes are limited to: - ExportObjectToElement - ImportObjectFromElement Fixes #3164
…e-button-on-kryptonform-when-using-a-custom-theme
…e-button-on-kryptonform-when-using-a-custom-theme


…g a custom theme
PR Description - #3183
Summary
Fix a rendering artifact (a small square) appearing next to the
KryptonFormClose (X) button when using a custom XML-based Krypton theme/palette.Root Cause
When importing a custom palette from XML, palette values that are omitted by the theme XML could remain at placeholder/default C# values instead of being initialized from the palette's
BasePalette. This could leave caption/button chrome in an invalid/partial state, producing a small stray visual element.Changes
In
KryptonCustomPaletteBase.ImportFromXmlDocument, the palette is now populated fromBasePalettebefore applying the XML overrides:PopulateFromBaseOperation(null)before importing theProperties/Imageselements from the XML.Why this works
The initial populate step ensures missing metrics/draw settings (including caption/button related values used by the form window buttons) are correctly inherited from the base palette. The subsequent XML import can then override only what the theme explicitly defines.
Files Modified
Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonCustomPaletteBase.csTesting
Microsoft365Pink) to aKryptonFormand verify the small square near the Close button is gone.Notes
dotnet buildwas not clean in this environment due to pre-existing MSBuild/resource configuration errors unrelated to this palette change.