Skip to content

Commit

Permalink
Merge pull request #953 from danwalmsley/features/shell-ui-avalonia-u…
Browse files Browse the repository at this point in the history
…pdate

UI Polish - Avalonia Updates
  • Loading branch information
nopara73 committed Dec 12, 2018
2 parents 1bec017 + aedfed6 commit b125787
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<AvaloniaVersion>0.7.1-build935-beta</AvaloniaVersion>
<AvaloniaVersion>0.7.1-build989-beta</AvaloniaVersion>
<AvaloniaBehaviorsVersion>0.7.0</AvaloniaBehaviorsVersion>
</PropertyGroup>

Expand Down
14 changes: 12 additions & 2 deletions WalletWasabi.Gui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xmlns:beh="clr-namespace:AvalonStudio.Utils.Behaviors;assembly=AvalonStudio.Utils"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Icon="resm:WalletWasabi.Gui.Assets.WasabiLogo.png?assembly=WalletWasabi.Gui"
Title="{Binding Title}" BorderThickness="1" BorderBrush="{DynamicResource AvalonBorderBrush}"
Title="{Binding Title}"
MinWidth="1100" MinHeight="530"
FontFamily="{DynamicResource UiFont}" FontSize="14"
Foreground="{DynamicResource ThemeForegroundBrush}"
Expand All @@ -23,8 +23,18 @@
<behaviors:PredicateCloseBehavior CanClose="{Binding CanClose}" />
</i:Interaction.Behaviors>
<cont:MetroWindow.TitleBarContent>
<menu:MainMenuView DataContext="{Binding Shell.MainMenu}" Margin="4 0 0 0" Foreground="{DynamicResource ThemeForegroundBrush}" VerticalAlignment="Stretch" FontSize="13" />
</cont:MetroWindow.TitleBarContent>
<Grid Margin="0,10,0,0">
<cont:MetroWindow.Styles>
<Style Selector="Menu > MenuItem:selected /template/ Border#root">
<Setter Property="Background" Value="{DynamicResource ThemeControlMidBrush}"/>
</Style>

<Style Selector="Menu > MenuItem">
<Setter Property="Padding" Value="7 0"/>
</Style>
</cont:MetroWindow.Styles>
<Grid>
<DockPanel LastChildFill="True">
<wasabi:StatusBar DockPanel.Dock="Bottom" DataContext="{Binding StatusBar}" />
<shell:ShellView DataContext="{Binding Shell}" />
Expand Down
27 changes: 26 additions & 1 deletion WalletWasabi.Gui/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Avalonia;
using Avalonia.Gtk3;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Extensibility.Platforms;
using NBitcoin;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
Expand Down Expand Up @@ -81,6 +83,29 @@ static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEv
Logger.LogWarning(e?.ExceptionObject as Exception, "UnhandledException");
}

private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
private static AppBuilder BuildAvaloniaApp()
{
var result = AppBuilder.Configure<App>();

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result
.UseWin32()
.UseDirect2D1();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
result.UseGtk3(new Gtk3PlatformOptions
{
UseDeferredRendering = true,
UseGpuAcceleration = true
}).UseSkia();
}
{
result.UsePlatformDetect();
}

return result;
}
}
}
11 changes: 0 additions & 11 deletions WalletWasabi.Gui/WalletWasabi.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

<ItemGroup>
<None Remove="Extensions\DummyHack.txt" />
<None Remove="msvcp140.dll" />
<None Remove="vcruntime140.dll" />
</ItemGroup>

<ItemGroup>
Expand All @@ -54,15 +52,6 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="msvcp140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="vcruntime140.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" />
</ItemGroup>
Expand Down
Binary file removed WalletWasabi.Gui/msvcp140.dll
Binary file not shown.
Binary file removed WalletWasabi.Gui/vcruntime140.dll
Binary file not shown.

0 comments on commit b125787

Please sign in to comment.