mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
任务栏小图标的右键菜单加入置顶选项 fix#335
This commit is contained in:
parent
5ad089a006
commit
1ecf948c2b
@ -1890,6 +1890,16 @@ namespace VPet_Simulator.Windows
|
||||
Checked = HitThrough
|
||||
};
|
||||
m_menu.Items.Add(hitThrough);
|
||||
var topmost = new MenuItem("置于顶层".Translate(), null, (x, y) =>
|
||||
{
|
||||
Topmost = ((MenuItem)x).Checked;
|
||||
})
|
||||
{
|
||||
Name = "NotifyIcon_TopMost",
|
||||
CheckOnClick = true,
|
||||
Checked = Topmost
|
||||
};
|
||||
m_menu.Items.Add(topmost);
|
||||
m_menu.Items.Add(new MenuItem("操作教程".Translate(), null, (x, y) =>
|
||||
{
|
||||
if (LocalizeCore.CurrentCulture == "zh-Hans")
|
||||
|
@ -31,7 +31,7 @@ namespace VPet_Simulator.Windows
|
||||
/// </summary>
|
||||
public partial class MainWindow : WindowX
|
||||
{
|
||||
private System.Windows.Forms.NotifyIcon notifyIcon;
|
||||
internal System.Windows.Forms.NotifyIcon notifyIcon;
|
||||
public PetHelper petHelper;
|
||||
public System.Timers.Timer AutoSaveTimer = new System.Timers.Timer();
|
||||
|
||||
@ -62,7 +62,7 @@ namespace VPet_Simulator.Windows
|
||||
LocalizeCore.TranslateFunc = (str) =>
|
||||
{
|
||||
var destr = Sub.TextDeReplace(str);
|
||||
if(destr == str)
|
||||
if (destr == str)
|
||||
return str;
|
||||
return destr.Translate();
|
||||
};
|
||||
|
@ -805,6 +805,7 @@ namespace VPet_Simulator.Windows
|
||||
if (!AllowChange)
|
||||
return;
|
||||
mw.Set.TopMost = true;
|
||||
(mw.notifyIcon.ContextMenuStrip.Items.Find("NotifyIcon_TopMost", false).First() as System.Windows.Forms.ToolStripMenuItem).Checked = true;
|
||||
}
|
||||
|
||||
private void TopMostBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
@ -812,6 +813,7 @@ namespace VPet_Simulator.Windows
|
||||
if (!AllowChange)
|
||||
return;
|
||||
mw.Set.TopMost = false;
|
||||
(mw.notifyIcon.ContextMenuStrip.Items.Find("NotifyIcon_TopMost", false).First() as System.Windows.Forms.ToolStripMenuItem).Checked = false;
|
||||
}
|
||||
|
||||
private void ZoomSlider_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user