Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1455-KComboBox-text-is-clipped #1538

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
PWagner1 marked this conversation as resolved.
Show resolved Hide resolved
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down