Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
Update Avalonia
Browse files Browse the repository at this point in the history
  • Loading branch information
x2bool committed May 1, 2019
1 parent d3e71ed commit 8092465
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 36 deletions.
6 changes: 3 additions & 3 deletions src/Tel.Egram.Application/Tel.Egram.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<RootNamespace>Tel.Egram.Application</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.Desktop" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia" Version="0.8.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.8.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.8.0" />
<PackageReference Include="DynamicData" Version="6.6.1.2507" />
<PackageReference Include="ReactiveUI" Version="9.0.1" />
<PackageReference Include="System.Reactive" Version="4.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Tel.Egram.Model/Tel.Egram.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia" Version="0.8.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.8.0" />
<PackageReference Include="DynamicData" Version="6.6.1.2507" />
<PackageReference Include="ReactiveUI" Version="9.0.1" />
<PackageReference Include="System.Reactive" Version="4.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Tel.Egram.Services/Tel.Egram.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia" Version="0.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ReactiveUI" Version="9.0.1" />
<PackageReference Include="System.Drawing.Common" Version="4.5.1" />
Expand Down
6 changes: 3 additions & 3 deletions src/Tel.Egram.Views/Tel.Egram.Views.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<RootNamespace>Tel.Egram.Views</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.Desktop" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia" Version="0.8.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.8.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.8.0" />
<PackageReference Include="DynamicData" Version="6.6.1.2507" />
<PackageReference Include="ReactiveUI" Version="9.0.1" />
<PackageReference Include="System.Reactive" Version="4.0.0" />
Expand Down
52 changes: 29 additions & 23 deletions src/Tel.Egram/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Avalonia;
using Avalonia.Gtk3;
using Avalonia.Platform;
using Splat;
using Tel.Egram.Application;
Expand Down Expand Up @@ -38,31 +37,38 @@ private static void Run(
{
var app = resolver.GetService<MainApplication>();
var builder = AppBuilder.Configure(app);
var os = builder.RuntimePlatform.GetRuntimeInfo().OperatingSystem;
var runtime = builder.RuntimePlatform.GetRuntimeInfo();
var model = new MainWindowModel();

if (os == OperatingSystemType.OSX)
switch (runtime.OperatingSystem)
{
builder.UseAvaloniaNative(null, opt =>
{
opt.MacOptions.ShowInDock = true;
opt.UseDeferredRendering = true;
opt.UseGpu = true;
}).UseSkia();
}
else if (os == OperatingSystemType.Linux)
{
builder.UseGtk3(new Gtk3PlatformOptions
{
UseDeferredRendering = true,
UseGpuAcceleration = true
}).UseSkia();
}
else
{
builder.UseWin32(
deferredRendering: true
).UseSkia();
case OperatingSystemType.OSX:
builder.UseAvaloniaNative()
.With(new AvaloniaNativePlatformOptions
{
UseGpu = true,
UseDeferredRendering = true
})
.UseSkia();
break;

case OperatingSystemType.Linux:
builder.UseX11()
.With(new X11PlatformOptions
{
UseGpu = true
})
.UseSkia();
break;

default:
builder.UseWin32()
.With(new Win32PlatformOptions
{
UseDeferredRendering = true
})
.UseSkia();
break;
}

builder.UseReactiveUI();
Expand Down
8 changes: 4 additions & 4 deletions src/Tel.Egram/Tel.Egram.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

<ItemGroup>
<PackageReference Update="Microsoft.NETCore.App" Version="2.1.5" />
<PackageReference Include="Avalonia" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.Desktop" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.Native" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.7.1-build1258-beta" />
<PackageReference Include="Avalonia" Version="0.8.0" />
<PackageReference Include="Avalonia.Desktop" Version="0.8.0" />
<PackageReference Include="Avalonia.Native" Version="0.8.0" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.8.0" />
<PackageReference Include="NSubsys" Version="0.7.0-build20180604-0047">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down

0 comments on commit 8092465

Please sign in to comment.