feat: add notify

master
ZGGSONG 2 years ago
parent 866d896df8
commit 0287e8cd62

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

@ -19,7 +19,7 @@
WindowStyle="None"
Height="450"
Width="400"
Icon="/Images/translate.ico">
Icon="/Images/translate2.ico">
<Border BorderThickness="0"
Background="#fff"
CornerRadius="10">
@ -34,7 +34,21 @@
Click="NotifyIcon_Click"
IsBlink="False"
Visibility="Visible"
Icon="/Images/translate.ico"/>
Icon="/Images/translate2.ico">
<hc:NotifyIcon.ContextMenu>
<ContextMenu>
<ContextMenu.Style>
<Style>
<Setter Property="ContextMenu.Width" Value="100"/>
</Style>
</ContextMenu.Style>
<MenuItem Command="hc:ControlCommands.PushMainWindow2Top"
Header="主界面"/>
<MenuItem Command="hc:ControlCommands.ShutdownApp"
Header="退出"/>
</ContextMenu>
</hc:NotifyIcon.ContextMenu>
</hc:NotifyIcon>
<!--input-->
<Grid x:Name="Input"

@ -119,5 +119,15 @@ namespace STranslate.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] translate2 {
get {
object obj = ResourceManager.GetObject("translate2", resourceCulture);
return ((byte[])(obj));
}
}
}
}

@ -127,6 +127,9 @@
<data name="translate1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\translate.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="translate2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\translate2.ico;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="translate_x128" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\translate_x128.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>

@ -4,7 +4,7 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>Images\translate.ico</ApplicationIcon>
<ApplicationIcon>Images\translate2.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
@ -12,6 +12,7 @@
<None Remove="Images\copy.png" />
<None Remove="Images\translate.ico" />
<None Remove="Images\translate.svg" />
<None Remove="Images\translate2.ico" />
<None Remove="Images\translate_x128.png" />
<None Remove="Images\translate_x256.png" />
<None Remove="Images\translate_x64.png" />
@ -38,6 +39,9 @@
<Resource Include="Images\translate.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\translate2.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\translate_x128.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>