Skip to content

Commit 53fb665

Browse files
committed
Added about window
1 parent 8a8b8d1 commit 53fb665

File tree

7 files changed

+104
-35
lines changed

7 files changed

+104
-35
lines changed

UedConverter/AboutWindow.xaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Window x:Class="UedConverter.AboutWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:UedConverter"
7+
mc:Ignorable="d"
8+
Title="AboutWindow" Height="192" Width="339" ResizeMode="NoResize">
9+
<Grid Background="{DynamicResource Background}">
10+
<Button Content="OK" Margin="0,0,10,10" HorizontalAlignment="Right" Width="85" Height="30" VerticalAlignment="Bottom" Click="OK_Click"/>
11+
<Image HorizontalAlignment="Left" Height="40" Margin="20,30,0,0" VerticalAlignment="Top" Width="40" Source="UedConverterLogo.ico" RenderTransformOrigin="0.875,1"/>
12+
<Label x:Name="titleLabel" Content="Title" HorizontalAlignment="Left" Margin="120,26,0,0" VerticalAlignment="Top" Width="175" FontWeight="Bold" FontSize="18" Foreground="{DynamicResource Text}"/>
13+
<Label x:Name="versionLabel" Content="Version" HorizontalAlignment="Left" Margin="120,54,0,0" VerticalAlignment="Top" Width="145" Foreground="{DynamicResource Text}" FontSize="11"/>
14+
<TextBlock HorizontalAlignment="Left" Margin="20,86,0,0" VerticalAlignment="Top" Width="301">
15+
<Hyperlink Name="gitLink" RequestNavigate="OpenUrl_Click"><TextBlock x:Name="linkText">URL</TextBlock></Hyperlink>
16+
</TextBlock>
17+
</Grid>
18+
</Window>

UedConverter/AboutWindow.xaml.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
using System.Windows.Controls;
9+
using System.Windows.Data;
10+
using System.Windows.Documents;
11+
using System.Windows.Input;
12+
using System.Windows.Media;
13+
using System.Windows.Media.Imaging;
14+
using System.Windows.Shapes;
15+
16+
namespace UedConverter
17+
{
18+
/// <summary>
19+
/// Interaction logic for AboutWindow.xaml
20+
/// </summary>
21+
public partial class AboutWindow : Window
22+
{
23+
public AboutWindow()
24+
{
25+
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
26+
Version version = assembly.GetName().Version;
27+
string name = assembly.GetName().Name;
28+
29+
InitializeComponent();
30+
31+
titleLabel.Content = name;
32+
versionLabel.Content = "v" + version.Major + "." + version.Minor;
33+
string gitUrl = "https://github.com/reszy/UEdConverter/releases";
34+
gitLink.NavigateUri = new Uri(gitUrl);
35+
linkText.Text = gitUrl;
36+
}
37+
38+
private void OK_Click(object sender, RoutedEventArgs e)
39+
{
40+
this.Close();
41+
}
42+
43+
private void OpenUrl_Click(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
44+
{
45+
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
46+
e.Handled = true;
47+
}
48+
}
49+
}

UedConverter/App.xaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
xmlns:local="clr-namespace:UedConverter"
55
StartupUri="MainWindow.xaml">
66
<Application.Resources>
7-
7+
<SolidColorBrush x:Key="Bg" Color="#FF252526"/>
8+
<SolidColorBrush x:Key="ButtonBg" Color="#FF3F3F46"/>
9+
<SolidColorBrush x:Key="Border" Color="#FF434346"/>
10+
<SolidColorBrush x:Key="Background" Color="#FF2D2D30"/>
11+
<SolidColorBrush x:Key="Text" Color="#FFD8D8D8"/>
812
</Application.Resources>
913
</Application>

UedConverter/MainWindow.xaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:UedConverter"
77
mc:Ignorable="d"
8-
Title="UedConverter" Height="327" Width="639" MaxHeight="327" MinWidth="499" MinHeight="327">
9-
<Window.Resources>
10-
<SolidColorBrush x:Key="Bg" Color="#FF252526"/>
11-
<SolidColorBrush x:Key="ButtonBg" Color="#FF3F3F46"/>
12-
<SolidColorBrush x:Key="Border" Color="#FF434346"/>
13-
<SolidColorBrush x:Key="Background" Color="#FF2D2D30"/>
14-
<SolidColorBrush x:Key="Text" Color="#FFD8D8D8"/>
15-
</Window.Resources>
8+
Title="UedConverter" Height="347" Width="639" MaxHeight="347" MinWidth="499" MinHeight="347">
169
<Grid Background="{DynamicResource Background}">
1710
<GroupBox Header="T3D -> OBJ" Height="125" Margin="15,15,10,0" VerticalAlignment="Top" BorderBrush="{DynamicResource Border}" Foreground="{DynamicResource Text}" BorderThickness="1"/>
1811
<Button Content="File" Width="100" Height="25" Margin="34,42,0,0" Background="{DynamicResource ButtonBg}" BorderBrush="{DynamicResource Border}" Foreground="{DynamicResource Text}" HorizontalAlignment="Left" VerticalAlignment="Top" Click="U2O_File_Click"/>
@@ -27,5 +20,6 @@
2720
<TextBlock x:Name="O2U_File_Textbox" Height="25" Margin="145,182,26,0" Text="" VerticalAlignment="Top" Foreground="{DynamicResource Text}" Background="{DynamicResource Bg}" TextOptions.TextFormattingMode="Display" TextTrimming="CharacterEllipsis" />
2821
<TextBlock x:Name="O2U_Destination_Textbox" Height="25" Margin="145,215,26,0" Text="" VerticalAlignment="Top" Foreground="{DynamicResource Text}" Background="{DynamicResource Bg}" TextOptions.TextFormattingMode="Display" TextTrimming="CharacterEllipsis" />
2922
<Button Content="Convert" Height="25" Margin="180,245,211,0" Background="{DynamicResource ButtonBg}" BorderBrush="{DynamicResource Border}" Foreground="{DynamicResource Text}" VerticalAlignment="Top" HorizontalAlignment="Center" Width="100" Click="O2U_Convert_Click"/>
23+
<Button Content="?" Height="21" Margin="15,285,0,0" Background="{DynamicResource ButtonBg}" BorderBrush="{DynamicResource Border}" Foreground="{DynamicResource Text}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="25" Click="About_Click"/>
3024
</Grid>
3125
</Window>

UedConverter/MainWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,10 @@ private void ShowError(string message)
146146
MessageBoxImage.Error
147147
);
148148
}
149+
150+
private void About_Click(object sender, RoutedEventArgs e)
151+
{
152+
(new AboutWindow()).ShowDialog();
153+
}
149154
}
150155
}

UedConverter/Properties/Resources.Designer.cs

Lines changed: 18 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UedConverter/UedConverter.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
<Generator>MSBuild:Compile</Generator>
5858
<SubType>Designer</SubType>
5959
</ApplicationDefinition>
60+
<Compile Include="AboutWindow.xaml.cs">
61+
<DependentUpon>AboutWindow.xaml</DependentUpon>
62+
</Compile>
6063
<Compile Include="Converter\ConvertionException.cs" />
6164
<Compile Include="Converter\FileSyntax.cs" />
6265
<Compile Include="Converter\FileUtils\ObjFile.cs" />
@@ -66,6 +69,10 @@
6669
<Compile Include="Converter\U2O_Converter.cs" />
6770
<Compile Include="Converter\V3d.cs" />
6871
<Compile Include="StringValue.cs" />
72+
<Page Include="AboutWindow.xaml">
73+
<SubType>Designer</SubType>
74+
<Generator>MSBuild:Compile</Generator>
75+
</Page>
6976
<Page Include="MainWindow.xaml">
7077
<Generator>MSBuild:Compile</Generator>
7178
<SubType>Designer</SubType>

0 commit comments

Comments
 (0)