Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Avalonia, fix performance issues and bugs. #29

Merged
merged 30 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36e9a31
Upgrade to .NET 8 and Avalonia 11.0.7
Vrabbers Jan 30, 2024
68984b1
Fix some loose ends
Vrabbers Jan 30, 2024
0069abc
Cleanup, remove Web for now
Vrabbers Feb 28, 2024
2d18acc
theme map
Vrabbers Feb 28, 2024
2ad6968
Clean up warnings and unuseds
Vrabbers Feb 28, 2024
ad8096c
and this as well...
Vrabbers Feb 28, 2024
a558055
Inertial pan, remove unused usings.
Vrabbers Feb 28, 2024
7f4c552
Make buttons full height to avoid misalignment
Vrabbers Feb 28, 2024
5dba189
Collection expressions, primary constructors. Do not update if player…
Vrabbers Feb 28, 2024
bc42ea5
Fix TTS, wrap long lines on message boxes.
Vrabbers Feb 29, 2024
0fad99a
Update application name on macOS
vicr123 Mar 1, 2024
b74dab4
Fix TTS on macOS
vicr123 Mar 1, 2024
9bd76d9
Fix bug where cancelling edit mode dialog would keep the button on. (…
Vrabbers Mar 2, 2024
ba87102
Player updating changes (fixes #31, #16)
Vrabbers Mar 2, 2024
391ce04
Further improvements to player update
Vrabbers Mar 2, 2024
751fbeb
Improve PlayerUpdate event perf, fix flickering ComboBox bug.
Vrabbers Mar 3, 2024
74ac51d
UI improvements
Vrabbers Mar 3, 2024
c4c0047
Update linux.yaml
Vrabbers Mar 3, 2024
aba96f3
Fix other workflow files
Vrabbers Mar 3, 2024
cd27f1a
This as well...
Vrabbers Mar 3, 2024
c7f7496
Upgrade actions workflows
Vrabbers Mar 3, 2024
7df6951
Update win.yaml
Vrabbers Mar 3, 2024
e3f9ed9
Add margins
Vrabbers Mar 3, 2024
9080940
Miscellaneous UI improvements
Vrabbers Mar 3, 2024
4284ecf
Merge branch 'main' into upgrade-avalonia
Vrabbers Mar 3, 2024
21d6cee
Increase blur, apply negative margin so dark edges do not appear.
Vrabbers Mar 4, 2024
8867d5c
Fix pan and zoom for go mode and follow me.
Vrabbers Mar 4, 2024
86e89f3
Fix go mode not updating block count.
Vrabbers Mar 4, 2024
a711752
Fix edit mode bugs.
Vrabbers Mar 5, 2024
041f4d6
...woops
Vrabbers Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
with:
submodules: 'recursive'
- name: "Install .NET"
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
- name: "Build Project"
run: dotnet publish BnbnavNetClient.Linux/BnbnavNetClient.Linux.csproj -c Release -r linux-x64 --self-contained
- name: "Create AppDir"
run: |
mkdir -p bnbnav.AppDir
cp -r BnbnavNetClient.Linux/bin/Release/net7.0/linux-x64/publish/* bnbnav.AppDir
cp -r BnbnavNetClient.Linux/bin/Release/net8.0/linux-x64/publish/* bnbnav.AppDir
cp dist/io.github.Vrabbers.bnbnav.desktop bnbnav.AppDir
cp dist/io.github.Vrabbers.bnbnav.svg bnbnav.AppDir
ln -s BnbnavNetClient.Linux bnbnav.AppDir/AppRun
Expand All @@ -36,7 +36,7 @@ jobs:
curl https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -o appimagetool-x86_64.AppImage -L
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage --appimage-extract-and-run bnbnav.AppDir
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: "Upload Artifact"
with:
name: "bnbnav-linux.AppImage"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
run: |
npm install -g appdmg
- name: "Install .NET"
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
- uses: actions/checkout@v1
with:
submodules: 'recursive'
Expand All @@ -36,7 +36,7 @@ jobs:
working-directory: dist
- name: "Create Disk Image"
run: appdmg dist/app-dmg-spec.json ./bnbnav-mac-${{ matrix.arch }}.dmg
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: "Upload Artifact"
with:
name: "bnbnav-mac-${{ matrix.arch }}.dmg"
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,30 @@ jobs:
strategy:
matrix:
os: [windows-latest]
arch: [x64, arm64]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
- name: "Install .NET"
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'
- name: "Build Project"
run: dotnet publish BnbnavNetClient.Windows/BnbnavNetClient.Windows.csproj -c Release -r win-x64 --self-contained
- uses: actions/upload-artifact@v3
run: dotnet publish BnbnavNetClient.Windows/BnbnavNetClient.Windows.csproj -c Release -r win-${{ matrix.arch }} --self-contained
- uses: actions/upload-artifact@v4
name: "Upload Artifact"
with:
name: "bnbnav-win"
path: "BnbnavNetClient.Windows/bin/Release/net7.0-windows/win-x64/publish"
name: "bnbnav-win-${{ matrix.arch }}"
path: "BnbnavNetClient.Windows/bin/Release/net8.0-windows/win-${{ matrix.arch }}/publish"
release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: "Download Artifact"
id: download
with:
Expand Down
4 changes: 2 additions & 2 deletions .idea/.idea.BnbnavNetClient/.idea/avalonia.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion BnbnavNetClient.I18Next/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Avalonia;
using BnbnavNetClient.I18Next.Services;
using Splat;

namespace BnbnavNetClient.I18Next;
public static class AppBuilderExtensions
{
public static AppBuilder UseI18NextLocalization(this AppBuilder appBuilder)
{
appBuilder.With<IAvaloniaI18Next>(new AvaloniaI18Next());
Locator.CurrentMutable.RegisterConstant<IAvaloniaI18Next>(new AvaloniaI18Next());
return appBuilder;
}
}
3 changes: 2 additions & 1 deletion BnbnavNetClient.I18Next/BnbnavNetClient.I18Next.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="I18Next.Net" Version="1.0.0" />
<PackageReference Include="Sepia.Globalization" Version="0.8.0" />
<PackageReference Include="Splat" Version="14.8.12" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions BnbnavNetClient.I18Next/Services/IAvaloniaI18Next.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
using System.Reflection;

namespace BnbnavNetClient.I18Next.Services;


//consider using singleton class since this is only ever used as the instance
public interface IAvaloniaI18Next
{
string this[string key, Dictionary<string, object?>? arguments] { get; }
Expand Down
3 changes: 2 additions & 1 deletion BnbnavNetClient.I18Next/TrString.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Avalonia;
using BnbnavNetClient.I18Next.Services;
using Splat;

namespace BnbnavNetClient.I18Next;
public sealed class TrString : AvaloniaObject
Expand Down Expand Up @@ -36,7 +37,7 @@ public IEnumerable<TrArgument> Arguments

public TrString()
{
_tr = AvaloniaLocator.Current.GetRequiredService<IAvaloniaI18Next>();
_tr = Locator.Current.GetService<IAvaloniaI18Next>() ?? throw new InvalidOperationException("AvaloniaI18Next must be registered for TrString to be constructed");
}

public override string ToString()
Expand Down
5 changes: 2 additions & 3 deletions BnbnavNetClient.I18Next/TranslateExtension.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

using Avalonia;
using Avalonia.Markup.Xaml;
using BnbnavNetClient.I18Next.Services;
using Splat;

namespace BnbnavNetClient.I18Next;

Expand All @@ -11,6 +10,6 @@ public sealed class Tr : MarkupExtension

public override object ProvideValue(IServiceProvider serviceProvider)
{
return AvaloniaLocator.Current.GetRequiredService<IAvaloniaI18Next>()[Key];
return Locator.Current.GetService<IAvaloniaI18Next>()![Key];
}
}
2 changes: 1 addition & 1 deletion BnbnavNetClient.Linux/BnbnavNetClient.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

Expand Down
15 changes: 5 additions & 10 deletions BnbnavNetClient.Linux/Program.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
// See https://aka.ms/new-console-template for more information

using Avalonia;
using Avalonia;
using Avalonia.ReactiveUI;
using Avalonia.Svg.Skia;
using BnbnavNetClient.I18Next;
using BnbnavNetClient.Linux.TextToSpeech;
using BnbnavNetClient.Services.TextToSpeech;
using BnbnavNetClient.Settings;

namespace BnbnavNetClient.Linux;

internal class Program
internal static class Program
{
public static void Main(string[] args)
{
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}

static AppBuilder BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
{
GC.KeepAlive(typeof(SvgImageExtension).Assembly);
GC.KeepAlive(typeof(Avalonia.Svg.Skia.Svg).Assembly);

return AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI()
.UseI18NextLocalization()
.With<ITextToSpeechProvider>(new SpdTextToSpeechProvider())
.UseTextToSpeechProvider(new SpdTextToSpeechProvider())
.UseSettings(new SettingsManagerJsonFile());
}
}
2 changes: 1 addition & 1 deletion BnbnavNetClient.Mac/BnbnavNetClient.Mac.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-macos10.14</TargetFramework>
<TargetFramework>net8.0-macos</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down
2 changes: 2 additions & 0 deletions BnbnavNetClient.Mac/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
<string>Main</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
<key>CFBundleDisplayName</key>
<string>bnbnav</string>
</dict>
</plist>
3 changes: 2 additions & 1 deletion BnbnavNetClient.Mac/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI()
.UseI18NextLocalization()
.With<ITextToSpeechProvider>(new MacTextToSpeechProvider())
.UseTextToSpeechProvider(new MacTextToSpeechProvider())
.UseSettings(new SettingsManagerJsonFile());

BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
2 changes: 1 addition & 1 deletion BnbnavNetClient.Web/BnbnavNetClient.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<InvariantGlobalization>false</InvariantGlobalization>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
Expand Down
3 changes: 2 additions & 1 deletion BnbnavNetClient.Windows/BnbnavNetClient.Windows.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
</PropertyGroup>

Expand All @@ -11,6 +11,7 @@

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="System.Speech" Version="8.0.0"/>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
</ItemGroup>
Expand Down
14 changes: 8 additions & 6 deletions BnbnavNetClient.Windows/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Avalonia;
using Avalonia;
using Avalonia.ReactiveUI;
using BnbnavNetClient.Windows.TextToSpeech;
using BnbnavNetClient.I18Next;
Expand All @@ -8,22 +7,25 @@

namespace BnbnavNetClient.Windows;

class Program
internal static class Program
{
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
public static void Main(string[] args)
{
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}

// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI()
.UseI18NextLocalization()
.With<ITextToSpeechProvider>(new WindowsTextToSpeechProvider())
.UseTextToSpeechProvider(new WindowsTextToSpeechProvider())
.UseSettings(new SettingsManagerJsonFile());
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Globalization;
using System.Globalization;
using System.Speech.Synthesis;
using System.Threading.Tasks;
using BnbnavNetClient.Services.TextToSpeech;

namespace BnbnavNetClient.Windows.TextToSpeech;
Expand Down
6 changes: 0 additions & 6 deletions BnbnavNetClient.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BnbnavNetClient", "BnbnavNe
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BnbnavNetClient.Windows", "BnbnavNetClient.Windows\BnbnavNetClient.Windows.csproj", "{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BnbnavNetClient.Web", "BnbnavNetClient.Web\BnbnavNetClient.Web.csproj", "{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3DA99C4E-89E3-4049-9C22-0A7EC60D83D8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Expand All @@ -35,10 +33,6 @@ Global
{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.Build.0 = Release|Any CPU
{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Release|Any CPU.Build.0 = Release|Any CPU
{F9360BD6-A251-478D-BDDA-6B57611055F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9360BD6-A251-478D-BDDA-6B57611055F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9360BD6-A251-478D-BDDA-6B57611055F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Loading