mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-06-20 19:30:31 +12:00
[Feature] Show loading as mouse cursor and extra loading menu (#161), version 1.0.17.42
This commit is contained in:
parent
d4fb5afdc7
commit
4fefc4f253
|
@ -804,32 +804,35 @@ namespace SystemTrayMenu.Business
|
|||
|
||||
private void HideOldMenu(Menu menuToShow, bool keepOrSetIsMenuOpen = false)
|
||||
{
|
||||
// Clean up menu status IsMenuOpen for previous one
|
||||
Menu menuPrevious = menus[menuToShow.Level - 1];
|
||||
DataGridView dgvPrevious = menuPrevious.GetDataGridView();
|
||||
foreach (DataRow row in ((DataTable)dgvPrevious.DataSource).Rows)
|
||||
if (menuPrevious != null)
|
||||
{
|
||||
RowData rowDataToClear = (RowData)row[2];
|
||||
if (rowDataToClear == (RowData)menuToShow.Tag)
|
||||
// Clean up menu status IsMenuOpen for previous one
|
||||
DataGridView dgvPrevious = menuPrevious.GetDataGridView();
|
||||
foreach (DataRow row in ((DataTable)dgvPrevious.DataSource).Rows)
|
||||
{
|
||||
rowDataToClear.IsMenuOpen = keepOrSetIsMenuOpen;
|
||||
RowData rowDataToClear = (RowData)row[2];
|
||||
if (rowDataToClear == (RowData)menuToShow.Tag)
|
||||
{
|
||||
rowDataToClear.IsMenuOpen = keepOrSetIsMenuOpen;
|
||||
}
|
||||
else
|
||||
{
|
||||
rowDataToClear.IsMenuOpen = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
RefreshSelection(dgvPrevious);
|
||||
|
||||
// Hide old menu
|
||||
foreach (Menu menuToClose in menus.Where(
|
||||
m => m != null && m.Level > menuPrevious.Level))
|
||||
{
|
||||
rowDataToClear.IsMenuOpen = false;
|
||||
menuToClose.VisibleChanged += MenuVisibleChanged;
|
||||
menuToClose.HideWithFade();
|
||||
menus[menuToClose.Level] = null;
|
||||
}
|
||||
}
|
||||
|
||||
RefreshSelection(dgvPrevious);
|
||||
|
||||
// Hide old menu
|
||||
foreach (Menu menuToClose in menus.Where(
|
||||
m => m != null && m.Level > menuPrevious.Level))
|
||||
{
|
||||
menuToClose.VisibleChanged += MenuVisibleChanged;
|
||||
menuToClose.HideWithFade();
|
||||
menus[menuToClose.Level] = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void FadeHalfOrOutIfNeeded()
|
||||
|
|
|
@ -173,10 +173,8 @@ namespace SystemTrayMenu.Handler
|
|||
{
|
||||
CloseMenu.Invoke(rowData.MenuLevel + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
CloseMenu.Invoke(rowData.MenuLevel + 1);
|
||||
}
|
||||
|
||||
CloseMenu.Invoke(rowData.MenuLevel + 1);
|
||||
|
||||
if (!rowData.IsContextMenuOpen &&
|
||||
rowData.ContainsMenu &&
|
||||
|
|
|
@ -99,6 +99,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
|
||||
public void LoadingStop()
|
||||
{
|
||||
Cursor.Current = Cursors.Default;
|
||||
threadsLoading = false;
|
||||
}
|
||||
|
||||
|
@ -116,6 +117,7 @@ namespace SystemTrayMenu.UserInterface
|
|||
{
|
||||
if (DateTime.Now - timeLoadingStart > new TimeSpan(0, 0, 0, 0, 500))
|
||||
{
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
notifyIcon.Icon = bitmapsLoading[loadCount++ % indexLoad];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue