[Feature] Option maximum menu height (#181), version 1.0.17.51

This commit is contained in:
Markus Hofknecht 2021-05-29 09:46:54 +02:00
parent bdaebea71a
commit 642b3a731e

View file

@ -486,6 +486,12 @@ namespace SystemTrayMenu.UserInterface
{
int dgvHeight = dgv.Rows.GetRowsHeight(DataGridViewElementStates.None); // Height of all rows
int dgvHeightMax = screenHeightMax - (Height - dgv.Height); // except dgv
if (dgvHeightMax > Properties.Settings.Default.MaximumMenuHeight)
{
dgvHeightMax = Properties.Settings.Default.MaximumMenuHeight;
}
if (dgvHeight > dgvHeightMax)
{
// Make all rows fit into the screen