Adapt layout depending on OS
MODIFY
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
WalletWasabi.Fluent/Views/Shell/TitleBarView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:searchBar="clr-namespace:WalletWasabi.Fluent.Views.SearchBar"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="1000"
- x:Class="WalletWasabi.Fluent.Views.Shell.TitleBarView">
- <Grid>
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="100"
+ x:Class="WalletWasabi.Fluent.Views.Shell.TitleBarView"
+ x:Name="UserControl">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="70" />
- <ColumnDefinition Width="70" />
- <ColumnDefinition Width="1*" />
- <ColumnDefinition Width="3*" MaxWidth="400" />
- <ColumnDefinition Width="1*" />
- <ColumnDefinition Width="140" />
- </Grid.ColumnDefinitions>
+ <UserControl.Resources>
- <DockPanel Grid.Column="{ext:Platform 0, Osx=1}" x:Name="Logo" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <DataTemplate x:Key="WasabiLogo">
<Viewbox Height="18" Width="18" IsHitTestVisible="False">
<Image Source="{DynamicResource wasabi_logo_dynamic}" />
</Viewbox>
- </DockPanel>
+ </DataTemplate>
- <DockPanel Grid.Column="{ext:Platform 1, Osx=2}" IsHitTestVisible="False" Grid.ColumnSpan="{ext:Platform 2, Osx=1}" x:Name="Title" VerticalAlignment="Center" Margin="8">
+ <DataTemplate x:Key="Title">
+ <DockPanel IsHitTestVisible="False" x:Name="Title" VerticalAlignment="Center" Margin="8">
<DockPanel.Styles>
<Style Selector="TextBlock">
<Setter Property="Margin" Value="3 0" />
<TextBlock Classes="h8" Text="Wasabi Wallet" />
<TextBlock Classes="h8" Opacity="0.6" Text="TESTNET PREVIEW" TextTrimming="CharacterEllipsis" />
</DockPanel>
+ </DataTemplate>
- <searchBar:SearchBar DataContext="{Binding SearchBar}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
- Grid.Row="0" Grid.Column="3" Margin="5"
+ <DataTemplate x:Key="SearchBar">
+ <searchBar:SearchBar DataContext="{Binding #UserControl.DataContext.SearchBar}" VerticalAlignment="Stretch"
+ HorizontalAlignment="Stretch"
+ Margin="5"
IsHitTestVisible="{Binding $parent.DataContext.IsMainContentEnabled, FallbackValue=True}" />
+ </DataTemplate>
- <statusBar:StatusBar Grid.Column="{ext:Platform 4, Osx=5}"
- Foreground="{DynamicResource AcrylicTrimForeground}" DataContext="{Binding StatusBar}"
+ <DataTemplate x:Key="StatusBar">
+ <statusBar:StatusBar Foreground="{DynamicResource AcrylicTrimForeground}"
+ DataContext="{Binding #UserControl.DataContext.StatusBar}"
HorizontalAlignment="Right" VerticalAlignment="Center"
IsHitTestVisible="{Binding $parent.DataContext.IsMainContentEnabled, FallbackValue=True}" />
+ </DataTemplate>
+
+ <DataTemplate x:Key="WindowsAndLinuxLayout">
+ <Grid>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="70" />
+ <ColumnDefinition Width="70" />
+ <ColumnDefinition Width="1*" />
+ <ColumnDefinition Width="3*" MaxWidth="400" />
+ <ColumnDefinition Width="1*" />
+ <ColumnDefinition Width="140" />
+ </Grid.ColumnDefinitions>
+
+ <ContentControl ContentTemplate="{StaticResource WasabiLogo}" />
+ <ContentControl Grid.Column="1" Grid.ColumnSpan="2" ContentTemplate="{StaticResource Title}" />
+ <ContentControl Grid.Column="3" ContentTemplate="{StaticResource SearchBar}" />
+ <ContentControl Grid.Column="4" ContentTemplate="{StaticResource StatusBar}" />
+
</Grid>
+ </DataTemplate>
+
+ <DataTemplate x:Key="MacOSLayout">
+ <Grid>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="75" />
+ <ColumnDefinition Width="1*" />
+ <ColumnDefinition Width="3*" MaxWidth="400" />
+ <ColumnDefinition Width="1*" />
+ <ColumnDefinition Width="75" />
+ </Grid.ColumnDefinitions>
+
+ <DockPanel Grid.Column="1">
+ <ContentControl ContentTemplate="{StaticResource WasabiLogo}" />
+ <ContentControl ContentTemplate="{StaticResource Title}" />
+ </DockPanel>
+ <ContentControl Grid.Column="2" ContentTemplate="{StaticResource SearchBar}" />
+ <ContentControl Grid.Column="3" Grid.ColumnSpan="2" ContentTemplate="{StaticResource StatusBar}" />
+
+ </Grid>
+ </DataTemplate>
+
+ </UserControl.Resources>
+
+ <ContentControl ContentTemplate="{ext:Platform {StaticResource WindowsAndLinuxLayout}, Osx={StaticResource MacOSLayout}}" />
+
</UserControl>
\ No newline at end of file

Adapt layout depending on OS