super tidy content area and margins, allow user to set background of header seperately.
MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml
WalletWasabi.Fluent/Controls/ContentArea.axaml
<Style Selector="c|ContentArea">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
+ <Setter Property="Background" Value="{DynamicResource RegionColor}" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
+ <Panel IsHitTestVisible="False" Background="{TemplateBinding Background}" />
<c:ProgressRing Name="LoadingRing" IsIndeterminate="True" IsVisible="{TemplateBinding IsBusy}" />
- <DockPanel Name="MainDockPanel" Margin="31,0,21,0" IsVisible="{Binding !#LoadingRing.IsVisible}">
- <StackPanel DockPanel.Dock="Top" Spacing="10" Margin="0 0 0 20">
+ <DockPanel Name="MainDockPanel" IsVisible="{Binding !#LoadingRing.IsVisible}">
+ <Panel DockPanel.Dock="Top">
+ <Panel IsHitTestVisible="False" Background="{TemplateBinding HeaderBackground}" />
+ <StackPanel Name="PART_Header" Spacing="10">
<DockPanel>
<Button Margin="-31,0,0,0" Classes="plain" Command="{Binding BackCommand}"
IsVisible="{TemplateBinding EnableBack}">
</DockPanel>
<ContentPresenter Name="PART_CaptionPresenter" Content="{TemplateBinding Caption}" />
</StackPanel>
+ </Panel>
+
<Panel DockPanel.Dock="Bottom" x:Name="PART_ButtonArea">
<Button Name="PART_CancelButton" IsCancel="{TemplateBinding EnableCancel}"
Classes="invisible" IsVisible="{TemplateBinding EnableCancel}"
- Content="{TemplateBinding CancelContent}" Margin="0,10,10,10"
+ Content="{TemplateBinding CancelContent}"
HorizontalAlignment="Left" Command="{Binding CancelCommand}">
<i:Interaction.Behaviors>
<behaviors:FocusOnAttachedBehavior
</Panel>
<ScrollViewer x:Name="PART_ScrollViewer"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
- VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" Padding="0 0 10 0">
+ VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<ContentControl Name="PART_ContentPresenter"
- Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ContentTemplate="{TemplateBinding ContentTemplate}"
</Setter>
</Style>
+ <Style Selector="c|ContentArea /template/ StackPanel#PART_Header">
+ <Setter Property="Margin" Value="31 0 31 0" />
+ </Style>
+
<Style Selector="c|ContentArea /template/ ScrollViewer#PART_ScrollViewer">
- <Setter Property="Margin" Value="0 0 0 32" />
+ <Setter Property="Margin" Value="31 31 31 21" />
+ </Style>
+
+ <Style Selector="c|ContentArea /template/ Panel#PART_ButtonArea">
+ <Setter Property="Margin" Value="31,10" />
</Style>
<Style Selector="c|ContentArea /template/ ContentPresenter#PART_TitlePresenter">

MODIFY
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
WalletWasabi.Fluent/Controls/ContentArea.axaml.cs
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Presenters;
+using Avalonia.Media;
namespace WalletWasabi.Fluent.Controls
{
@@ -42,6 +43,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<bool> IsBusyProperty =
AvaloniaProperty.Register<ContentArea, bool>(nameof(IsBusy));
+ public static readonly StyledProperty<IBrush> HeaderBackgroundProperty =
+ AvaloniaProperty.Register<ContentArea, IBrush>(nameof(HeaderBackground));
+
private IContentPresenter? _titlePresenter;
private IContentPresenter? _captionPresenter;
@@ -117,6 +121,12 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(IsBusyProperty, value);
}
+ public IBrush HeaderBackground
+ {
+ get => GetValue(HeaderBackgroundProperty);
+ set => SetValue(HeaderBackgroundProperty, value);
+ }
+
protected override bool RegisterContentPresenter(IContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

MODIFY
WalletWasabi.Fluent/Styles/Themes/BaseDark.axaml
WalletWasabi.Fluent/Styles/Themes/BaseDark.axaml
<SolidColorBrush x:Key="TileRegionColor">#FF2B2B2B</SolidColorBrush>
<Color x:Key="RegionColor">#FF212121</Color>
+ <Color x:Key="HeaderRegionColor">#FF242424</Color>
<BoxShadows x:Key="BoxShadow">0 1 4 #121212</BoxShadows>
<BoxShadows x:Key="OptionButtonShadow">0 2 2 #121212</BoxShadows>

MODIFY
WalletWasabi.Fluent/Styles/Themes/BaseLight.axaml
WalletWasabi.Fluent/Styles/Themes/BaseLight.axaml
<SolidColorBrush x:Key="TileRegionColor">#FFFFFF</SolidColorBrush>
<Color x:Key="RegionColor">#FAFAFA</Color>
+ <Color x:Key="HeaderRegionColor">#FFFBFBFB</Color>
<BoxShadows x:Key="BoxShadow">0 1 4 #D1D1D1</BoxShadows>
<BoxShadows x:Key="OptionButtonShadow">0 2 2 #D1D1D1</BoxShadows>

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
<Style Selector="ContentControl c|ContentArea /template/ Panel#PART_ButtonArea">
<Setter Property="IsVisible" Value="False" />
</Style>
+
+ <Style Selector="c|ContentArea /template/ StackPanel#PART_Header">
+ <Setter Property="Margin" Value="31 36 31 0" />
+ </Style>
</Panel.Styles>
<Border Background="{DynamicResource RegionColor}" BoxShadow="{DynamicResource BoxShadow}" IsHitTestVisible="False" />
- <ContentControl ClipToBounds="False" Content="{Binding MainScreen.CurrentPage}" Margin="20 36 20 20" />
+ <ContentControl ClipToBounds="False" Content="{Binding MainScreen.CurrentPage}" />
</Panel>
</DockPanel>
</Panel>

MODIFY
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
WalletWasabi.Fluent/Views/Wallets/WalletView.axaml
x:CompileBindings="True"
ClipToBounds="False"
x:Class="WalletWasabi.Fluent.Views.Wallets.WalletView">
- <c:ContentArea ScrollViewer.VerticalScrollBarVisibility="Disabled" ClipToBounds="False">
+ <c:ContentArea ScrollViewer.VerticalScrollBarVisibility="Disabled" ClipToBounds="False" HeaderBackground="{DynamicResource HeaderRegionColor}">
<c:ContentArea.Title>
<StackPanel>
<DockPanel>

super tidy content area and margins, allow user to set background of header seperately.