From 1580943426617d3a35dc5cc529a645e95d8e10b0 Mon Sep 17 00:00:00 2001 From: Giduac Date: Mon, 17 Jun 2024 12:51:26 +0200 Subject: [PATCH 1/2] 1455-KComboBox-text-is-clipped ItemHeight sizing by Font Height adjusted. And the Changelog. --- Documents/Changelog/Changelog.md | 1 + .../Controls Toolkit/KryptonComboBox.cs | 53 +++++++++++-------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/Documents/Changelog/Changelog.md b/Documents/Changelog/Changelog.md index fd95691c5..874fad720 100644 --- a/Documents/Changelog/Changelog.md +++ b/Documents/Changelog/Changelog.md @@ -3,6 +3,7 @@ ======= ## 2024-11-xx - Build 2411 - November 2024 +* Resolved [#1455] (https://github.com/Krypton-Suite/Standard-Toolkit/issues/1455), **[Regression]** KryptonComboBox text is clipped; as height is incorrect. * Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1502), Docking Persistence broken since build `##.23.10.303` * Resolved [#1522]()https://github.com/Krypton-Suite/Standard-Toolkit/issues/1522), **[Breaking Change]** Check `ThemeManager` & `KryptonManager` for the use of hard coded theme indexes. See issue for full details. * Resolved [#239](https://github.com/Krypton-Suite/Standard-Toolkit/issues/239), Toolstrip combo boxes do not have the theme background applied diff --git a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs index 5d3ce2811..542b73838 100644 --- a/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs +++ b/Source/Krypton Components/Krypton.Toolkit/Controls Toolkit/KryptonComboBox.cs @@ -225,27 +225,38 @@ protected override void OnEnabledChanged(EventArgs e) protected override void OnFontChanged(EventArgs e) { // Working on Windows XP or earlier systems? - if (_osMajorVersion < 6) - { - // Fudge by adding one to the font height, this gives the actual space used by the - // combo box control to draw an individual item in the main part of the control - ItemHeight = Font.Height + 1; - } - else - { - // Vista performs differently depending of the use of themes... - if (IsAppThemed) - { - // Fudge by subtracting 1, which ensure correct sizing of combo box main area - ItemHeight = Font.Height - 1; - } - else - { - // On under Vista without themes is the font height the actual height used - // by the combo box for the space required for drawing the actual item - ItemHeight = Font.Height; - } - } + //if (_osMajorVersion < 6) + //{ + // // Fudge by adding one to the font height, this gives the actual space used by the + // // combo box control to draw an individual item in the main part of the control + // ItemHeight = Font.Height + 1; + //} + //else + //{ + // // Vista performs differently depending of the use of themes... + // if (IsAppThemed) + // { + // // Fudge by subtracting 1, which ensure correct sizing of combo box main area + // //ItemHeight = Font.Height - 1; + + // // #1455 - The lower part of the text can become clipped with chars like g, y, p, etc. + // // when subtracting one from the font height. + // ItemHeight = Font.Height; + // } + // else + // { + // // On under Vista without themes is the font height the actual height used + // // by the combo box for the space required for drawing the actual item + // ItemHeight = Font.Height; + // } + //} + + // #1455 - The lower part of the text can become clipped with chars like g, y, p, etc. + // when subtracting one from the font height. + ItemHeight = _osMajorVersion < 6 + ? Font.Height + 1 + : Font.Height; + base.OnFontChanged(e); } From 315e43645121ba69e1e7528fc3aa0e5e50c894f1 Mon Sep 17 00:00:00 2001 From: Giduac Date: Mon, 17 Jun 2024 15:37:35 +0200 Subject: [PATCH 2/2] 1455-KComboBox-text-is-clipped And the Changelog. --- Documents/Changelog/Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documents/Changelog/Changelog.md b/Documents/Changelog/Changelog.md index 874fad720..63b01a9c3 100644 --- a/Documents/Changelog/Changelog.md +++ b/Documents/Changelog/Changelog.md @@ -3,7 +3,6 @@ ======= ## 2024-11-xx - Build 2411 - November 2024 -* Resolved [#1455] (https://github.com/Krypton-Suite/Standard-Toolkit/issues/1455), **[Regression]** KryptonComboBox text is clipped; as height is incorrect. * Resolved [#1381](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1502), Docking Persistence broken since build `##.23.10.303` * Resolved [#1522]()https://github.com/Krypton-Suite/Standard-Toolkit/issues/1522), **[Breaking Change]** Check `ThemeManager` & `KryptonManager` for the use of hard coded theme indexes. See issue for full details. * Resolved [#239](https://github.com/Krypton-Suite/Standard-Toolkit/issues/239), Toolstrip combo boxes do not have the theme background applied @@ -108,6 +107,7 @@ * Version bump `85.xx.xx.xx` -> `90.xx.xx.xx` ## 2024-06-24 - Build 2406 - June 2024 +* Resolved [#1455](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1455), **[Regression]** KryptonComboBox text is clipped; as height is incorrect. * Resolved [#619](https://github.com/Krypton-Suite/Standard-Toolkit/issues/619), KButton and KListbox unclear text color in certain scenarios * Resolved [#1516](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1516), Theme Office 2010 Black Dark Mode causes a crash * Resolved [#1328](https://github.com/Krypton-Suite/Standard-Toolkit/issues/1328), Tentative adjustment to bring PaletteMode and the theme dictionary in line.