mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-29 08:39:34 +12:00
[BUG] max menu handling (#202), version 1.0.19.5
This commit is contained in:
parent
0e7c59af0c
commit
8e83943044
|
@ -212,12 +212,12 @@ namespace SystemTrayMenu.Business
|
|||
waitToOpenMenu.CloseMenu += CloseMenu;
|
||||
void CloseMenu(int level)
|
||||
{
|
||||
if (menus[level] != null)
|
||||
if (level < menus.Count() && menus[level] != null)
|
||||
{
|
||||
HideOldMenu(menus[level]);
|
||||
}
|
||||
|
||||
if (menus[level - 1] != null)
|
||||
if (level - 1 < menus.Count() && menus[level - 1] != null)
|
||||
{
|
||||
menus[level - 1].FocusTextBox();
|
||||
}
|
||||
|
@ -1055,10 +1055,13 @@ namespace SystemTrayMenu.Business
|
|||
searchTextChanging = false;
|
||||
|
||||
// if any open menu close
|
||||
Menu menuToClose = menus[menu.Level + 1];
|
||||
if (menuToClose != null)
|
||||
if (menu.Level + 1 < menus.Count())
|
||||
{
|
||||
HideOldMenu(menuToClose);
|
||||
Menu menuToClose = menus[menu.Level + 1];
|
||||
if (menuToClose != null)
|
||||
{
|
||||
HideOldMenu(menuToClose);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,13 +259,6 @@ namespace SystemTrayMenu.UserInterface
|
|||
textBoxSearch.Visible = false;
|
||||
tableLayoutPanelSearch.Visible = false;
|
||||
break;
|
||||
case MenuType.MaxReached:
|
||||
SetTitle($"Max {MenuDefines.MenusMax - 1} Menus");
|
||||
labelTitle.BackColor = MenuDefines.ColorTitleWarning;
|
||||
pictureBoxSearch.Visible = false;
|
||||
textBoxSearch.Visible = false;
|
||||
tableLayoutPanelSearch.Visible = false;
|
||||
break;
|
||||
case MenuType.Loading:
|
||||
SetTitle(Translator.GetText("loading"));
|
||||
pictureBoxSearch.Visible = false;
|
||||
|
|
|
@ -250,6 +250,31 @@ namespace SystemTrayMenu.UserInterface
|
|||
numericUpDownSizeInPercentage.Minimum = 100;
|
||||
numericUpDownSizeInPercentage.Maximum = 200;
|
||||
numericUpDownSizeInPercentage.Increment = 25;
|
||||
numericUpDownSizeInPercentage.MouseWheel += NumericUpDownSizeInPercentage_MouseWheel;
|
||||
void NumericUpDownSizeInPercentage_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
decimal newValue = numericUpDownSizeInPercentage.Value;
|
||||
if (e.Delta > 0)
|
||||
{
|
||||
newValue = newValue + numericUpDownSizeInPercentage.Increment;
|
||||
if (newValue > numericUpDownSizeInPercentage.Maximum)
|
||||
{
|
||||
newValue = (int)numericUpDownSizeInPercentage.Maximum;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newValue = newValue - numericUpDownSizeInPercentage.Increment;
|
||||
if (newValue < numericUpDownSizeInPercentage.Minimum)
|
||||
{
|
||||
newValue = (int)numericUpDownSizeInPercentage.Minimum;
|
||||
}
|
||||
}
|
||||
|
||||
numericUpDownSizeInPercentage.Value = newValue;
|
||||
((HandledMouseEventArgs)e).Handled = true;
|
||||
}
|
||||
|
||||
numericUpDownSizeInPercentage.Value = Settings.Default.SizeInPercentage;
|
||||
|
||||
numericUpDownMenuWidth.Minimum = 50;
|
||||
|
|
Loading…
Reference in a new issue