Skip to content

Commit ac174bb

Browse files
author
Flier
committed
加入About頁面
1 parent 7764a14 commit ac174bb

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed

ConvertZZ/ConvertZZ.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@
108108
<DependentUpon>Page_File.xaml</DependentUpon>
109109
</Compile>
110110
<Compile Include="Settings.cs" />
111+
<Compile Include="Window_About.xaml.cs">
112+
<DependentUpon>Window_About.xaml</DependentUpon>
113+
</Compile>
111114
<Compile Include="Window_DialogHost.xaml.cs">
112115
<DependentUpon>Window_DialogHost.xaml</DependentUpon>
113116
</Compile>
@@ -147,6 +150,10 @@
147150
<SubType>Designer</SubType>
148151
<Generator>MSBuild:Compile</Generator>
149152
</Page>
153+
<Page Include="Window_About.xaml">
154+
<SubType>Designer</SubType>
155+
<Generator>MSBuild:Compile</Generator>
156+
</Page>
150157
<Page Include="Window_DialogHost.xaml">
151158
<SubType>Designer</SubType>
152159
<Generator>MSBuild:Compile</Generator>

ConvertZZ/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
</MenuItem>
5050
<MenuItem Uid="1" Header="隱藏/顯示懸浮球" Click="MenuItem_Click"/>
5151
<MenuItem Header="Setting" Click="Setting_Click"/>
52+
<MenuItem Header="About" Click="About_Click"/>
5253
<MenuItem Header="Exit" Click="Exit_Click"/>
5354
</ContextMenu>
5455
</Window.Resources>

ConvertZZ/MainWindow.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ private void Window_MouseDown(object sender, MouseButtonEventArgs e)
8888
this.DragMove();
8989
}
9090
}
91+
private void About_Click(object sender, RoutedEventArgs e)
92+
{
93+
Window_About window_About = new Window_About();
94+
window_About.ShowDialog();
95+
}
9196
private void Setting_Click(object sender, RoutedEventArgs e)
9297
{
9398
UnRegAllHotkey();
@@ -101,8 +106,7 @@ private void Exit_Click(object sender, RoutedEventArgs e)
101106
App.nIcon.Visible = false;
102107
App.nIcon.Dispose();
103108
Environment.Exit(0);
104-
}
105-
109+
}
106110
private void Window_MouseUp(object sender, MouseButtonEventArgs e)
107111
{
108112
ContextMenu NotifyIconMenu = (ContextMenu)this.FindResource("NotifyIconMenu");

ConvertZZ/Window_About.xaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Window x:Class="ConvertZZ.Window_About"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
mc:Ignorable="d"
7+
Title="About" MinHeight="200" MinWidth="350" ResizeMode="NoResize" Topmost="True" SizeToContent="WidthAndHeight">
8+
<StackPanel>
9+
<StackPanel Orientation="Horizontal" Margin="5">
10+
<Grid Width="100" Height="150" MouseUp="Label_MouseUp">
11+
<Grid.Background>
12+
<ImageBrush ImageSource="icon.ico" Stretch="Uniform"/>
13+
</Grid.Background>
14+
</Grid>
15+
<Label Content="ConvertZZ" FontSize="40" FontFamily="Arial" VerticalAlignment="Center" MouseUp="Label_MouseUp"/>
16+
</StackPanel>
17+
<Grid Margin="5">
18+
<Grid.ColumnDefinitions>
19+
<ColumnDefinition/>
20+
<ColumnDefinition/>
21+
</Grid.ColumnDefinitions>
22+
<Label Content="Make by flier268" HorizontalAlignment="Left"/>
23+
<Label Content="GPL-3.0 Licence" Grid.Column="1" HorizontalAlignment="Right" Margin="0"/>
24+
</Grid>
25+
</StackPanel>
26+
</Window>

ConvertZZ/Window_About.xaml.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Diagnostics;
2+
using System.Windows;
3+
using System.Windows.Input;
4+
5+
namespace ConvertZZ
6+
{
7+
/// <summary>
8+
/// Window_About.xaml 的互動邏輯
9+
/// </summary>
10+
public partial class Window_About : Window
11+
{
12+
public Window_About()
13+
{
14+
InitializeComponent();
15+
}
16+
17+
private void Label_MouseUp(object sender, MouseButtonEventArgs e)
18+
{
19+
Process.Start("https://github.com/flier268/ConvertZZ");
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)