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 all commits
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 @@ -107,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.
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