Show licenses in About view

Closes #4
This commit is contained in:
2026-03-03 11:10:56 +09:00
parent 94c8945140
commit 32228e143f
3 changed files with 460 additions and 0 deletions
+12
View File
@@ -22,6 +22,18 @@
<TextBlock Text="App icon made using https://gauger.me/fonticon/ with FontAwesome icon 'file-invoice-dollar' and the macOS software Icon Composer."
TextWrapping="Wrap"
FontSize="14"/>
<Label Content="Open Source Licenses:"/>
<ScrollViewer Margin="2"
Grid.Row="4"
x:Name="LogScrollView"
VerticalScrollBarVisibility="Visible"
AllowAutoHide="False"
MaxHeight="250">
<SelectableTextBlock Margin="2"
TextWrapping="Wrap"
FontSize="10"
x:Name="LicenseTextBlock"/>
</ScrollViewer>
<TextBlock Text="Copyright 2026 - Quickity Quack Productions"
TextWrapping="Wrap"
HorizontalAlignment="Center"
+22
View File
@@ -1,4 +1,5 @@
using System;
using System.IO;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
@@ -10,6 +11,27 @@ namespace MayShow.Views
public AboutView()
{
this.InitializeComponent();
// set license text
var licenseFileName = "Assets/LICENSES.txt";
var licenseText = "";
if (File.Exists(licenseFileName))
{
licenseText = File.ReadAllText(licenseFileName);
}
else
{
licenseFileName = "../Resources/Assets/LICENSES.txt";
if (File.Exists(licenseFileName))
{
licenseText = File.ReadAllText(licenseFileName);
}
else
{
licenseText = "Error: Unable to find license file!";
}
}
LicenseTextBlock.Text = licenseText;
}
}
}