Skip to content

Commit

Permalink
change ico,optimize user experience
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyRabbit committed Aug 31, 2017
1 parent b81d8e2 commit 4d849b2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
8 changes: 4 additions & 4 deletions AntiRecall/AntiRecall.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>main.ico</ApplicationIcon>
<ApplicationIcon>main-blue.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down Expand Up @@ -161,9 +161,6 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="main.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\socks5\socks5\socks5.csproj">
<Project>{b1a31708-7ac8-44c9-bbb3-999bebe1fa5b}</Project>
Expand All @@ -181,6 +178,9 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Resource Include="main-blue.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
32 changes: 20 additions & 12 deletions AntiRecall/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ private void init_minimize()
ni.ContextMenu = contextMenu;
ni.Visible = true;
#if DEBUG
ni.Icon = new Icon("../../Resources/main.ico");
ni.Icon = new Icon("../../Resources/main-blue.ico");
#else
ShortCut.currentDirectory = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName);

ni.Icon = new Icon(ShortCut.currentDirectory + "\\Resources\\main.ico");
ni.Icon = new Icon(ShortCut.currentDirectory + "\\Resources\\main-blue.ico");

#endif
ni.DoubleClick +=
Expand Down Expand Up @@ -130,6 +130,7 @@ private void StartButton_Click(object sender, RoutedEventArgs e)
//process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.StartInfo.CreateNoWindow = true;
process.Start();
MinimizeWindow();
}
catch (Exception)
{
Expand Down Expand Up @@ -163,15 +164,28 @@ private void Explorer_Click(object sender, RoutedEventArgs e)

}

protected override void OnStateChanged(EventArgs e)
private void menuItem1_Click(object Sender, EventArgs e)
{
if (WindowState == System.Windows.WindowState.Minimized)
this.Hide();
ni.Visible = false;
if (proxy != null)
proxy.Stop();
Close();
}

private void MinimizeWindow()
{
this.Hide();

ni.BalloonTipTitle = "AntiRecall";
ni.BalloonTipText = "已将AntiRecall最小化到托盘,程序将在后台运行";
ni.BalloonTipIcon = ToolTipIcon.Info;
ni.ShowBalloonTip(30000);
}

protected override void OnStateChanged(EventArgs e)
{
if (WindowState == System.Windows.WindowState.Minimized)
MinimizeWindow();
base.OnStateChanged(e);
}

Expand All @@ -184,12 +198,6 @@ protected override void OnClosed(EventArgs e)
App.Current.Shutdown();
}

private void menuItem1_Click(object Sender, EventArgs e)
{
ni.Visible = false;
if (proxy != null)
proxy.Stop();
Close();
}

}
}
Binary file added AntiRecall/Resources/main-blue.ico
Binary file not shown.
Binary file removed AntiRecall/Resources/main.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion AntiRecall/deploy/ShortCut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static void init_shortcut(string filename)
{
if (currentDirectory == null)
currentDirectory = System.IO.Directory.GetCurrentDirectory();
myVersion = "1.1.0";
myVersion = "1.1.1";

if (!CheckShortCut(filename))
{
Expand Down
Binary file added AntiRecall/main-blue.ico
Binary file not shown.
Binary file removed AntiRecall/main.ico
Binary file not shown.

0 comments on commit 4d849b2

Please sign in to comment.