Add support for increasing height independently from width
MODIFY
WalletWasabi.Fluent/Controls/Dialog.axaml
WalletWasabi.Fluent/Controls/Dialog.axaml
<Setter Property="Margin" Value="0 40" />
</Style>
+ <!-- Dialog Increased height State -->
+ <Style Selector="c|Dialog[IncreasedHeightEnabled=True] /template/ Border#PART_Border">
+ <Setter Property="Margin" Value="40 0" />
+ </Style>
+
+ <!-- Dialog Increased size State -->
+ <Style Selector="c|Dialog[IncreasedSizeEnabled=True] /template/ Border#PART_Border">
+ <Setter Property="Margin" Value="0 0" />
+ </Style>
+
<!-- Dialog Fullscreen State -->
<Style Selector="c|Dialog[FullScreenEnabled=True] /template/ Border#PART_Border">
<Setter Property="Margin" Value="0 30 0 0" />

MODIFY
WalletWasabi.Fluent/Controls/Dialog.axaml.cs
WalletWasabi.Fluent/Controls/Dialog.axaml.cs
@@ -50,6 +50,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<double> IncreasedWidthThresholdProperty =
AvaloniaProperty.Register<Dialog, double>(nameof(IncreasedWidthThreshold), double.NaN);
+ public static readonly StyledProperty<double> IncreasedHeightThresholdProperty =
+ AvaloniaProperty.Register<Dialog, double>(nameof(IncreasedHeightThreshold), double.NaN);
+
public static readonly StyledProperty<double> FullScreenHeightThresholdProperty =
AvaloniaProperty.Register<Dialog, double>(nameof(FullScreenHeightThreshold), double.NaN);
@@ -59,6 +62,12 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<bool> IncreasedWidthEnabledProperty =
AvaloniaProperty.Register<Dialog, bool>(nameof(IncreasedWidthEnabled));
+ public static readonly StyledProperty<bool> IncreasedHeightEnabledProperty =
+ AvaloniaProperty.Register<Dialog, bool>(nameof(IncreasedHeightEnabled));
+
+ public static readonly StyledProperty<bool> IncreasedSizeEnabledProperty =
+ AvaloniaProperty.Register<Dialog, bool>(nameof(IncreasedSizeEnabled));
+
public Dialog()
{
this.GetObservable(IsDialogOpenProperty).Subscribe(UpdateDelay);
@@ -69,10 +78,22 @@ namespace WalletWasabi.Fluent.Controls
var width = bounds.Width;
var height = bounds.Height;
var increasedWidthThreshold = IncreasedWidthThreshold;
+ var increasedHeightThreshold = IncreasedHeightThreshold;
var fullScreenHeightThreshold = FullScreenHeightThreshold;
- IncreasedWidthEnabled = !double.IsNaN(increasedWidthThreshold)
+
+ var increasedWidthEnabled = !double.IsNaN(increasedWidthThreshold)
&& width < increasedWidthThreshold;
- FullScreenEnabled = IncreasedWidthEnabled
+
+ var increasedHeightEnabled = !double.IsNaN(increasedHeightThreshold)
+ && height < increasedHeightThreshold;
+
+ IncreasedWidthEnabled = increasedWidthEnabled && !increasedHeightEnabled;
+
+ IncreasedHeightEnabled = !increasedWidthEnabled && increasedHeightEnabled;
+
+ IncreasedSizeEnabled = increasedWidthEnabled && increasedHeightEnabled;
+
+ FullScreenEnabled = increasedWidthEnabled
&& !double.IsNaN(fullScreenHeightThreshold)
&& height < fullScreenHeightThreshold;
});
@@ -138,6 +159,12 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(IncreasedWidthThresholdProperty, value);
}
+ public double IncreasedHeightThreshold
+ {
+ get => GetValue(IncreasedHeightThresholdProperty);
+ set => SetValue(IncreasedHeightThresholdProperty, value);
+ }
+
public double FullScreenHeightThreshold
{
get => GetValue(FullScreenHeightThresholdProperty);
@@ -156,6 +183,18 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(IncreasedWidthEnabledProperty, value);
}
+ private bool IncreasedHeightEnabled
+ {
+ get => GetValue(IncreasedHeightEnabledProperty);
+ set => SetValue(IncreasedHeightEnabledProperty, value);
+ }
+
+ private bool IncreasedSizeEnabled
+ {
+ get => GetValue(IncreasedSizeEnabledProperty);
+ set => SetValue(IncreasedSizeEnabledProperty, value);
+ }
+
private CancellationTokenSource? CancelPointerPressedDelay { get; set; }
private void UpdateDelay(bool isDialogOpen)

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
IsEnabled="{Binding $parent.DataContext.IsFullScreenEnabled}"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- IncreasedWidthThreshold="740" FullScreenHeightThreshold="580">
+ IncreasedWidthThreshold="740" IncreasedHeightThreshold="580" FullScreenHeightThreshold="580">
<c:Dialog.Styles>
<Style Selector="c|Dialog /template/ Panel#PART_Overlay">
<Setter Property="Background" Value="{DynamicResource RegionColor}" />
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
MaxContentWidth="800" MaxContentHeight="700"
- IncreasedWidthThreshold="740" FullScreenHeightThreshold="580">
+ IncreasedWidthThreshold="740" IncreasedHeightThreshold="580" FullScreenHeightThreshold="580">
<c:Dialog.Styles>
<Style Selector="c|Dialog[FullScreenEnabled=True]">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
EnableCancelOnEscape="{Binding CurrentPage.EnableCancelOnEscape, FallbackValue=True}"
IsEnabled="{Binding $parent.DataContext.IsDialogScreenEnabled}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- IncreasedWidthThreshold="740" FullScreenHeightThreshold="580">
+ IncreasedWidthThreshold="740" IncreasedHeightThreshold="580" FullScreenHeightThreshold="580">
<c:Dialog.Styles>
<Style Selector="c|Dialog[FullScreenEnabled=True]">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />

Add support for increasing height independently from width