Add about dialog and versioning

This commit is contained in:
Nicolò P 2024-01-12 12:07:36 +01:00
parent 356dc796c8
commit 7938149c90
4 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,4 @@
using System.Reflection;
using System.Windows; using System.Windows;
[assembly: ThemeInfo( [assembly: ThemeInfo(

View File

@ -26,7 +26,7 @@
<ImageBrush Stretch="Uniform" ImageSource="/copy-icon.png"/> <ImageBrush Stretch="Uniform" ImageSource="/copy-icon.png"/>
</Button.OpacityMask> </Button.OpacityMask>
</Button> </Button>
<Menu x:Name="FileMenu" Margin="22,53,561,527" Background="#FF4B4E5D" MouseLeave="FileMenu_LostMouseFocus" Visibility="Collapsed"> <Menu x:Name="FileMenu" Margin="22,53,561,497" Background="#FF4B4E5D" MouseLeave="FileMenu_LostMouseFocus" Visibility="Collapsed">
<Menu.ItemsPanel> <Menu.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/> <VirtualizingStackPanel Orientation="Vertical"/>
@ -35,7 +35,8 @@
<Label x:Name="OpenOutputDir" Content="Apri cartella output..." Foreground="White" FontSize="14" MouseDown="OpenOutputDir_MouseDown" Cursor="Hand" Width="160" HorizontalAlignment="Center" Margin="0,6,0,0" > <Label x:Name="OpenOutputDir" Content="Apri cartella output..." Foreground="White" FontSize="14" MouseDown="OpenOutputDir_MouseDown" Cursor="Hand" Width="160" HorizontalAlignment="Center" Margin="0,6,0,0" >
</Label> </Label>
<Label x:Name="Help" Content="Help" Foreground="White" FontSize="14" MouseDown="Help_MouseDown" Cursor="Hand" Width="161" Margin="0,6,0,0"/> <Label x:Name="Help" Content="Help" Foreground="White" FontSize="14" MouseDown="Help_MouseDown" Cursor="Hand" Width="161" Margin="0,6,0,0"/>
<Label x:Name="Exit" Content="Esci..." Foreground="White" FontSize="14" MouseDown="Exit_MouseDown" Cursor="Hand" Width="163" Margin="0,6,0,10"/> <Label x:Name="About" Content="About" Foreground="White" FontSize="14" MouseDown="About_MouseDown" Cursor="Hand" Width="161" Margin="0,6,0,0"/>
<Label x:Name="Exit" Content="Esci..." Foreground="White" FontSize="14" MouseDown="Exit_MouseDown" Cursor="Hand" Width="163" Margin="0,6,0,0"/>
</Menu> </Menu>
<Button x:Name="ToggleMenu" Content="" HorizontalAlignment="Left" Margin="12,14,0,0" VerticalAlignment="Top" RenderTransformOrigin="0,0.202" Height="42" Width="47" BorderBrush="{x:Null}" Foreground="{x:Null}" Cursor="Hand" Click="ToggleMenu_Click"> <Button x:Name="ToggleMenu" Content="" HorizontalAlignment="Left" Margin="12,14,0,0" VerticalAlignment="Top" RenderTransformOrigin="0,0.202" Height="42" Width="47" BorderBrush="{x:Null}" Foreground="{x:Null}" Cursor="Hand" Click="ToggleMenu_Click">
<Button.OpacityMask> <Button.OpacityMask>

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -118,11 +119,6 @@ namespace Txt2Bib
System.Diagnostics.Process.Start("explorer.exe", OutputDir); System.Diagnostics.Process.Start("explorer.exe", OutputDir);
} }
private void MenuExec_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
Execute();
}
private void Exit_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) private void Exit_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{ {
Environment.Exit(0); Environment.Exit(0);
@ -139,5 +135,11 @@ namespace Txt2Bib
{ {
FileMenu.Visibility = Visibility.Collapsed; FileMenu.Visibility = Visibility.Collapsed;
} }
private void About_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
MessageBox.Show($"Txt2Bib version {Assembly.GetExecutingAssembly().GetName().Version}\n" +
"Powered by Nicopa", "About", MessageBoxButton.OK, MessageBoxImage.Information);
}
} }
} }

View File

@ -5,6 +5,7 @@
<TargetFramework>net6.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<Version>0.3.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>