mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
force update pw icon by hide and then show it
This commit is contained in:
parent
41603fd49e
commit
ea555b45b8
3 changed files with 13 additions and 7 deletions
|
@ -158,10 +158,11 @@ namespace PersistentWindows.Common
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
public delegate void CallBack();
|
public delegate void CallBack();
|
||||||
public CallBack showRestoreTip;
|
public delegate void CallBackBool(bool en = true);
|
||||||
public CallBack hideRestoreTip;
|
|
||||||
|
public CallBack showRestoreTip;
|
||||||
|
public CallBackBool hideRestoreTip;
|
||||||
|
|
||||||
public delegate void CallBackBool(bool en);
|
|
||||||
public CallBackBool enableRestoreSnapshotMenu;
|
public CallBackBool enableRestoreSnapshotMenu;
|
||||||
public delegate void CallBackBool2(bool en, bool en2);
|
public delegate void CallBackBool2(bool en, bool en2);
|
||||||
public CallBackBool2 enableRestoreMenu;
|
public CallBackBool2 enableRestoreMenu;
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace PersistentWindows.SystrayShell
|
||||||
User32.KeyModifier modifier = (User32.KeyModifier)((int)m.LParam & 0xFFFF); // The modifier of the hotkey that was pressed.
|
User32.KeyModifier modifier = (User32.KeyModifier)((int)m.LParam & 0xFFFF); // The modifier of the hotkey that was pressed.
|
||||||
int id = m.WParam.ToInt32(); // The id of the hotkey that was pressed.
|
int id = m.WParam.ToInt32(); // The id of the hotkey that was pressed.
|
||||||
|
|
||||||
Program.ShowRestoreTip();
|
Program.HideRestoreTip(false); //hide icon
|
||||||
Program.HideRestoreTip(); //show icon
|
Program.HideRestoreTip(); //show icon
|
||||||
hkwin.HotKeyPressed();
|
hkwin.HotKeyPressed();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -415,12 +415,12 @@ namespace PersistentWindows.SystrayShell
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HideRestoreTip()
|
public static void HideRestoreTip(bool show_icon = true)
|
||||||
{
|
{
|
||||||
if (systrayForm.contextMenuStripSysTray.InvokeRequired)
|
if (systrayForm.contextMenuStripSysTray.InvokeRequired)
|
||||||
systrayForm.contextMenuStripSysTray.BeginInvoke((Action)delegate ()
|
systrayForm.contextMenuStripSysTray.BeginInvoke((Action)delegate ()
|
||||||
{
|
{
|
||||||
HideRestoreTip();
|
HideRestoreTip(show_icon);
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -428,7 +428,12 @@ namespace PersistentWindows.SystrayShell
|
||||||
ni.Icon = IdleIcon;
|
ni.Icon = IdleIcon;
|
||||||
|
|
||||||
if (Gui)
|
if (Gui)
|
||||||
ni.Visible = true;
|
{
|
||||||
|
if (show_icon)
|
||||||
|
ni.Visible = true;
|
||||||
|
else
|
||||||
|
ni.Visible = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue