mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-20 19:30:31 +12:00
[BUG] ArgumentOutOfRangeException #110 [BUG] AutosizeRows when high dpi #111
This commit is contained in:
parent
fe02510cf6
commit
65159276d7
|
@ -89,12 +89,15 @@ namespace SystemTrayMenu.Handler
|
|||
|
||||
internal void EnterOpensInstantly(DataGridView dgv, int rowIndex)
|
||||
{
|
||||
timerStartLoad.Stop();
|
||||
StopLoadMenu.Invoke();
|
||||
SetData(dgv, rowIndex);
|
||||
MouseActive = false;
|
||||
checkForMouseActive = false;
|
||||
CallOpenMenuNow();
|
||||
if (dgv.Rows.Count > rowIndex)
|
||||
{
|
||||
timerStartLoad.Stop();
|
||||
StopLoadMenu.Invoke();
|
||||
SetData(dgv, rowIndex);
|
||||
MouseActive = false;
|
||||
checkForMouseActive = false;
|
||||
CallOpenMenuNow();
|
||||
}
|
||||
}
|
||||
|
||||
internal void MouseMove(object sender, MouseEventArgs e)
|
||||
|
|
|
@ -37,7 +37,6 @@ namespace SystemTrayMenu.UserInterface
|
|||
|
||||
private readonly Fading fading = new Fading();
|
||||
private bool isShowing = false;
|
||||
private bool dgvAutoResizeRowDone = false;
|
||||
|
||||
internal Menu()
|
||||
{
|
||||
|
@ -242,10 +241,14 @@ namespace SystemTrayMenu.UserInterface
|
|||
internal void AdjustSizeAndLocation(Menu menuPredecessor = null,
|
||||
bool directionToRight = false)
|
||||
{
|
||||
if (!dgvAutoResizeRowDone)
|
||||
CheckForAutoResizeRowDone();
|
||||
void CheckForAutoResizeRowDone()
|
||||
{
|
||||
dgv.AutoResizeRows();
|
||||
dgvAutoResizeRowDone = true;
|
||||
if (!(bool)dgv.Tag)
|
||||
{
|
||||
dgv.AutoResizeRows();
|
||||
dgv.Tag = true;
|
||||
}
|
||||
}
|
||||
|
||||
int dgvHeightNeeded = dgv.Rows.GetRowsHeight(
|
||||
|
@ -277,14 +280,14 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
if (directionToRight)
|
||||
{
|
||||
x = menuPredecessor.Location.X +
|
||||
x = menuPredecessor.Location.X +
|
||||
menuPredecessor.Width -
|
||||
(int)Math.Round(Scaling.Factor, 0,
|
||||
MidpointRounding.AwayFromZero);
|
||||
}
|
||||
else
|
||||
{
|
||||
x = menuPredecessor.Location.X -
|
||||
x = menuPredecessor.Location.X -
|
||||
Width +
|
||||
(int)Math.Round(Scaling.Factor, 0,
|
||||
MidpointRounding.AwayFromZero);
|
||||
|
|
Loading…
Reference in a new issue