Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Sponsor and GitHub buttons in the app
KnifeLemona9178857f4b7
diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.jsonindex 3d54c92d..e5e83094 100644--- a/src/Filee.App/Assets/i18n/en.json+++ b/src/Filee.App/Assets/i18n/en.json@@ -435,7 +435,8 @@"about.notices": "Third-party notices","about.github": "GitHub repository","about.support_title": "Help Filee grow",- "about.support_text": "Filee is free and open source. A star on GitHub, a bug report or a feature idea all help it get better and reach more people.",+ "about.support_text": "Filee is free and open source. A star on GitHub, a bug report, a feature idea or a sponsorship all help it get better and reach more people.",+ "about.sponsor": "Sponsor","feedback.notice_title": "Is Filee helping you?","feedback.notice_text": "A star on GitHub helps other people find Filee. Problems and ideas are welcome too.","feedback.star": "Star on GitHub",diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.jsonindex 9ddc1180..bc2b25e9 100644--- a/src/Filee.App/Assets/i18n/ko.json+++ b/src/Filee.App/Assets/i18n/ko.json@@ -435,7 +435,8 @@"about.notices": "서드파티 고지","about.github": "GitHub 저장소","about.support_title": "Filee 응원하기",- "about.support_text": "Filee는 무료 오픈소스예요. GitHub 별, 버그 신고, 기능 제안 모두 Filee가 나아지고 더 많은 분께 알려지는 데 큰 힘이 돼요.",+ "about.support_text": "Filee는 무료 오픈소스예요. GitHub 별, 버그 신고, 기능 제안, 후원 모두 Filee가 나아지고 더 많은 분께 알려지는 데 큰 힘이 돼요.",+ "about.sponsor": "후원하기","feedback.notice_title": "Filee가 도움이 되고 있나요?","feedback.notice_text": "GitHub에 별(⭐)을 남겨 주시면 다른 분들이 Filee를 찾는 데 큰 도움이 돼요. 불편한 점이나 원하는 기능도 알려 주세요.","feedback.star": "GitHub에서 별 주기",diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.jsonindex 0fd9a441..b1b95f41 100644--- a/src/Filee.App/Assets/i18n/zh-CN.json+++ b/src/Filee.App/Assets/i18n/zh-CN.json@@ -435,7 +435,8 @@"about.notices": "第三方声明","about.github": "GitHub 仓库","about.support_title": "支持 Filee",- "about.support_text": "Filee 免费开源。在 GitHub 上点星、报告错误或提出功能建议,都能帮助它变得更好、让更多人知道。",+ "about.support_text": "Filee 免费开源。在 GitHub 上点星、报告错误、提出功能建议或赞助,都能帮助它变得更好、让更多人知道。",+ "about.sponsor": "赞助","feedback.notice_title": "Filee 对你有帮助吗?","feedback.notice_text": "在 GitHub 上点个星(⭐)能帮助更多人发现 Filee。也欢迎反馈问题或提出想法。","feedback.star": "在 GitHub 上点星",diff --git a/src/Filee.App/Styles/Icons.axaml b/src/Filee.App/Styles/Icons.axamlindex a7429d05..6b8fca43 100644--- a/src/Filee.App/Styles/Icons.axaml+++ b/src/Filee.App/Styles/Icons.axaml@@ -28,6 +28,8 @@<StreamGeometry x:Key="Icon.Alert">M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z</StreamGeometry><StreamGeometry x:Key="Icon.Pencil">M3,17.25V21h3.75L17.81,9.94l-3.75-3.75L3,17.25z M20.71,7.04c0.39-0.39,0.39-1.02,0-1.41l-2.34-2.34c-0.39-0.39-1.02-0.39-1.41,0l-1.83,1.83l3.75,3.75L20.71,7.04z</StreamGeometry><StreamGeometry x:Key="Icon.Link">M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z</StreamGeometry>+ <StreamGeometry x:Key="Icon.GitHub">M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z</StreamGeometry>+ <StreamGeometry x:Key="Icon.Heart">M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z</StreamGeometry><StreamGeometry x:Key="Icon.Refresh">M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z</StreamGeometry><StreamGeometry x:Key="Icon.Record">M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7Z</StreamGeometry></ResourceDictionary>diff --git a/src/Filee.App/Styles/Soft.axaml b/src/Filee.App/Styles/Soft.axamlindex 207672cb..e1f8e23d 100644--- a/src/Filee.App/Styles/Soft.axaml+++ b/src/Filee.App/Styles/Soft.axaml@@ -142,6 +142,13 @@<Setter Property="Background" Value="Transparent" /><Setter Property="BorderThickness" Value="0" /></Style>+ <!-- Small links at the bottom of the navigation (GitHub, Sponsor) -->+ <Style Selector="Button.navlink">+ <Setter Property="Padding" Value="8,6" />+ <Setter Property="FontSize" Value="12" />+ <Setter Property="Background" Value="{DynamicResource SurfaceAltBrush}" />+ <Setter Property="BorderThickness" Value="0" />+ </Style><Style Selector="Button.icon"><Setter Property="Padding" Value="8" /><Setter Property="Background" Value="Transparent" />diff --git a/src/Filee.App/ViewModels/MainWindowViewModel.cs b/src/Filee.App/ViewModels/MainWindowViewModel.csindex 37b8c6ac..d042ec50 100644--- a/src/Filee.App/ViewModels/MainWindowViewModel.cs+++ b/src/Filee.App/ViewModels/MainWindowViewModel.cs@@ -31,6 +31,12 @@ public sealed partial class MainWindowViewModel : ObservableObjectprivate readonly IServiceProvider _services;private readonly ILocalizer _loc;+ /// <summary>The repository, for the GitHub button above the version.</summary>+ public string RepositoryUrl => UpdateService.RepositoryUrl;++ /// <summary>Where the Sponsor button above the version leads in the current language.</summary>+ public string SponsorUrl => AboutPageViewModel.SponsorUrlFor(_loc.Language);+public MainWindowViewModel(IServiceProvider services, ILocalizer loc, UpdateService updates){_services = services;diff --git a/src/Filee.App/ViewModels/Pages/AboutPageViewModel.cs b/src/Filee.App/ViewModels/Pages/AboutPageViewModel.csindex 22a84c49..46205f2c 100644--- a/src/Filee.App/ViewModels/Pages/AboutPageViewModel.cs+++ b/src/Filee.App/ViewModels/Pages/AboutPageViewModel.cs@@ -29,6 +29,16 @@ public sealed partial class AboutPageViewModel : ObservableObject, IDisposablepublic string Version { get; }public string RepositoryUrl { get; } = UpdateService.RepositoryUrl;+ /// <summary>Sponsoring in Korean goes to Fairy (Korean cards and easy-pay), otherwise to GitHub Sponsors.</summary>+ public const string FairyUrl = "https://fairy.hada.io/@filee";++ public const string GitHubSponsorsUrl = "https://github.com/sponsors/KnifeLemon";++ /// <summary>Where "Sponsor" leads in the current language.</summary>+ public string SponsorUrl => SponsorUrlFor(_loc.Language);++ public static string SponsorUrlFor(string language) => language == "ko" ? FairyUrl : GitHubSponsorsUrl;+/// <summary>The page is rebuilt on every visit; the update service lives on.</summary>public void Dispose() => _updates.PropertyChanged -= OnUpdatesChanged;diff --git a/src/Filee.App/Views/MainWindow.axaml b/src/Filee.App/Views/MainWindow.axamlindex 7bd24e27..66f5d9d1 100644--- a/src/Filee.App/Views/MainWindow.axaml+++ b/src/Filee.App/Views/MainWindow.axaml@@ -29,6 +29,21 @@<TextBlock Text="{Binding UpdateText}" TextTrimming="CharacterEllipsis" /></StackPanel></Button>+ <!-- The project on GitHub, and sponsoring it -->+ <Grid ColumnDefinitions="*,6,*">+ <Button Classes="navlink" HorizontalAlignment="Stretch" Click="OnOpenGitHub" ToolTip.Tip="{Binding RepositoryUrl}">+ <StackPanel Orientation="Horizontal" Spacing="6" HorizontalAlignment="Center">+ <PathIcon Width="13" Height="13" Data="{StaticResource Icon.GitHub}" />+ <TextBlock Text="GitHub" />+ </StackPanel>+ </Button>+ <Button Grid.Column="2" Classes="navlink" HorizontalAlignment="Stretch" Click="OnSponsor">+ <StackPanel Orientation="Horizontal" Spacing="6" HorizontalAlignment="Center">+ <PathIcon Width="13" Height="13" Data="{StaticResource Icon.Heart}" Foreground="#D4537E" />+ <TextBlock Text="{DynamicResource about.sponsor}" />+ </StackPanel>+ </Button>+ </Grid><TextBlock x:Name="VersionLabel" Classes="caption" Margin="8,0,0,0" Text="{Binding VersionText}" /></StackPanel><ListBox Classes="nav" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">diff --git a/src/Filee.App/Views/MainWindow.axaml.cs b/src/Filee.App/Views/MainWindow.axaml.csindex 82110467..9c287a63 100644--- a/src/Filee.App/Views/MainWindow.axaml.cs+++ b/src/Filee.App/Views/MainWindow.axaml.cs@@ -1,5 +1,7 @@using Avalonia.Controls;+using Avalonia.Interactivity;using Filee.App.Services;+using Filee.App.ViewModels;namespace Filee.App.Views;@@ -11,6 +13,18 @@ public partial class MainWindow : WindowMotion.Track(this);}+ private async void OnOpenGitHub(object? sender, RoutedEventArgs e)+ {+ if (DataContext is MainWindowViewModel vm)+ await Launcher.LaunchUriAsync(new Uri(vm.RepositoryUrl));+ }++ private async void OnSponsor(object? sender, RoutedEventArgs e)+ {+ if (DataContext is MainWindowViewModel vm)+ await Launcher.LaunchUriAsync(new Uri(vm.SponsorUrl));+ }+/// <summary>Closing the window keeps Filee running in the tray (Quit is in the tray menu).</summary>protected override void OnClosing(WindowClosingEventArgs e){diff --git a/src/Filee.App/Views/Pages/AboutPage.axaml b/src/Filee.App/Views/Pages/AboutPage.axamlindex a0d2101c..30610d89 100644--- a/src/Filee.App/Views/Pages/AboutPage.axaml+++ b/src/Filee.App/Views/Pages/AboutPage.axaml@@ -44,7 +44,13 @@<TextBlock Classes="muted" TextWrapping="Wrap" Text="{DynamicResource about.support_text}" /><WrapPanel><Button Classes="accent" Click="OnStar" Margin="0,0,8,0" Content="{DynamicResource feedback.star}" />- <Button Click="OnIssue" Content="{DynamicResource feedback.issue}" />+ <Button Click="OnIssue" Content="{DynamicResource feedback.issue}" Margin="0,0,8,0" />+ <Button Click="OnSponsor">+ <StackPanel Orientation="Horizontal" Spacing="6">+ <PathIcon Width="13" Height="13" Data="{StaticResource Icon.Heart}" Foreground="#D4537E" />+ <TextBlock Text="{DynamicResource about.sponsor}" />+ </StackPanel>+ </Button></WrapPanel></StackPanel></Border>diff --git a/src/Filee.App/Views/Pages/AboutPage.axaml.cs b/src/Filee.App/Views/Pages/AboutPage.axaml.csindex 37603044..39f6ab52 100644--- a/src/Filee.App/Views/Pages/AboutPage.axaml.cs+++ b/src/Filee.App/Views/Pages/AboutPage.axaml.cs@@ -17,6 +17,12 @@ public partial class AboutPage : UserControl// A star is given on the repository page itself.private void OnStar(object? sender, RoutedEventArgs e) => OnOpenRepository(sender, e);+ private async void OnSponsor(object? sender, RoutedEventArgs e)+ {+ if (DataContext is AboutPageViewModel vm && TopLevel.GetTopLevel(this) is { } top)+ await top.Launcher.LaunchUriAsync(new Uri(vm.SponsorUrl));+ }+private async void OnIssue(object? sender, RoutedEventArgs e){if (TopLevel.GetTopLevel(this) is { } top)diff --git a/tests/Filee.App.Tests/AboutSponsorTests.cs b/tests/Filee.App.Tests/AboutSponsorTests.csnew file mode 100644index 00000000..7a9bacf0--- /dev/null+++ b/tests/Filee.App.Tests/AboutSponsorTests.cs@@ -0,0 +1,24 @@+// "Sponsor" on the About page leads to Fairy in Korean (Korean cards and easy-pay) and to GitHub Sponsors otherwise.++using Avalonia.Headless.XUnit;+using Filee.App.Services;+using Filee.App.ViewModels.Pages;+using Filee.Core.Localization;+using Filee.Core.Settings;++namespace Filee.App.Tests;++public class AboutSponsorTests+{+ [AvaloniaTheory]+ [InlineData("ko", AboutPageViewModel.FairyUrl)]+ [InlineData("en", AboutPageViewModel.GitHubSponsorsUrl)]+ [InlineData("zh-CN", AboutPageViewModel.GitHubSponsorsUrl)]+ public void Sponsor_leads_where_the_language_can_pay(string language, string url)+ {+ TestServices.EnsureInitialized(language);+ using var about = new AboutPageViewModel(AppHost.Get<ILocalizer>(), AppHost.Get<UserDataStore>(), AppHost.Get<UpdateService>());++ Assert.Equal(url, about.SponsorUrl);+ }+}