Add width and height thresholds
MODIFY
WalletWasabi.Fluent/Controls/Dialog.axaml.cs
WalletWasabi.Fluent/Controls/Dialog.axaml.cs
@@ -47,6 +47,12 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<double> MaxContentWidthProperty =
AvaloniaProperty.Register<Dialog, double>(nameof(MaxContentWidth), double.PositiveInfinity);
+ public static readonly StyledProperty<double> IncreasedWidthThresholdProperty =
+ AvaloniaProperty.Register<Dialog, double>(nameof(IncreasedWidthThreshold), double.NaN);
+
+ public static readonly StyledProperty<double> FullScreenHeightThresholdProperty =
+ AvaloniaProperty.Register<Dialog, double>(nameof(FullScreenHeightThreshold), double.NaN);
+
public static readonly StyledProperty<bool> FullScreenEnabledProperty =
AvaloniaProperty.Register<Dialog, bool>(nameof(FullScreenEnabled));
@@ -62,8 +68,13 @@ namespace WalletWasabi.Fluent.Controls
{
var width = bounds.Width;
var height = bounds.Height;
- IncreasedWidthEnabled = width < 740;
- FullScreenEnabled = IncreasedWidthEnabled && height < 580;
+ var increasedWidthThreshold = IncreasedWidthThreshold;
+ var fullScreenHeightThreshold = FullScreenHeightThreshold;
+ IncreasedWidthEnabled = !double.IsNaN(increasedWidthThreshold)
+ && width < increasedWidthThreshold;
+ FullScreenEnabled = IncreasedWidthEnabled
+ && !double.IsNaN(fullScreenHeightThreshold)
+ && height < fullScreenHeightThreshold;
});
}
@@ -121,6 +132,18 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(MaxContentWidthProperty, value);
}
+ public double IncreasedWidthThreshold
+ {
+ get => GetValue(IncreasedWidthThresholdProperty);
+ set => SetValue(IncreasedWidthThresholdProperty, value);
+ }
+
+ public double FullScreenHeightThreshold
+ {
+ get => GetValue(FullScreenHeightThresholdProperty);
+ set => SetValue(FullScreenHeightThresholdProperty, value);
+ }
+
private bool FullScreenEnabled
{
get => GetValue(FullScreenEnabledProperty);

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

Add width and height thresholds