Skip to content

Commit

Permalink
Merge pull request #1538 from giduac/1455-KComboBox-text-is-clipped
Browse files Browse the repository at this point in the history
1455-KComboBox-text-is-clipped
  • Loading branch information
Smurf-IV authored Jun 19, 2024
2 parents 0d80827 + 315e436 commit 69ee190
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
1 change: 1 addition & 0 deletions Documents/Changelog/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,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

0 comments on commit 69ee190

Please sign in to comment.