mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-27 18:40:32 +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)
|
internal void EnterOpensInstantly(DataGridView dgv, int rowIndex)
|
||||||
{
|
{
|
||||||
timerStartLoad.Stop();
|
if (dgv.Rows.Count > rowIndex)
|
||||||
StopLoadMenu.Invoke();
|
{
|
||||||
SetData(dgv, rowIndex);
|
timerStartLoad.Stop();
|
||||||
MouseActive = false;
|
StopLoadMenu.Invoke();
|
||||||
checkForMouseActive = false;
|
SetData(dgv, rowIndex);
|
||||||
CallOpenMenuNow();
|
MouseActive = false;
|
||||||
|
checkForMouseActive = false;
|
||||||
|
CallOpenMenuNow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void MouseMove(object sender, MouseEventArgs e)
|
internal void MouseMove(object sender, MouseEventArgs e)
|
||||||
|
|
|
@ -37,7 +37,6 @@ namespace SystemTrayMenu.UserInterface
|
||||||
|
|
||||||
private readonly Fading fading = new Fading();
|
private readonly Fading fading = new Fading();
|
||||||
private bool isShowing = false;
|
private bool isShowing = false;
|
||||||
private bool dgvAutoResizeRowDone = false;
|
|
||||||
|
|
||||||
internal Menu()
|
internal Menu()
|
||||||
{
|
{
|
||||||
|
@ -242,10 +241,14 @@ namespace SystemTrayMenu.UserInterface
|
||||||
internal void AdjustSizeAndLocation(Menu menuPredecessor = null,
|
internal void AdjustSizeAndLocation(Menu menuPredecessor = null,
|
||||||
bool directionToRight = false)
|
bool directionToRight = false)
|
||||||
{
|
{
|
||||||
if (!dgvAutoResizeRowDone)
|
CheckForAutoResizeRowDone();
|
||||||
|
void CheckForAutoResizeRowDone()
|
||||||
{
|
{
|
||||||
dgv.AutoResizeRows();
|
if (!(bool)dgv.Tag)
|
||||||
dgvAutoResizeRowDone = true;
|
{
|
||||||
|
dgv.AutoResizeRows();
|
||||||
|
dgv.Tag = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int dgvHeightNeeded = dgv.Rows.GetRowsHeight(
|
int dgvHeightNeeded = dgv.Rows.GetRowsHeight(
|
||||||
|
@ -277,14 +280,14 @@ namespace SystemTrayMenu.UserInterface
|
||||||
{
|
{
|
||||||
if (directionToRight)
|
if (directionToRight)
|
||||||
{
|
{
|
||||||
x = menuPredecessor.Location.X +
|
x = menuPredecessor.Location.X +
|
||||||
menuPredecessor.Width -
|
menuPredecessor.Width -
|
||||||
(int)Math.Round(Scaling.Factor, 0,
|
(int)Math.Round(Scaling.Factor, 0,
|
||||||
MidpointRounding.AwayFromZero);
|
MidpointRounding.AwayFromZero);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x = menuPredecessor.Location.X -
|
x = menuPredecessor.Location.X -
|
||||||
Width +
|
Width +
|
||||||
(int)Math.Round(Scaling.Factor, 0,
|
(int)Math.Round(Scaling.Factor, 0,
|
||||||
MidpointRounding.AwayFromZero);
|
MidpointRounding.AwayFromZero);
|
||||||
|
|
Loading…
Reference in a new issue