QuestionControl highlight button
MODIFY
WalletWasabi.Fluent/Controls/QuestionControl.axaml
WalletWasabi.Fluent/Controls/QuestionControl.axaml
<ControlTemplate>
<DockPanel VerticalAlignment="Center" HorizontalAlignment="Stretch">
<DockPanel HorizontalAlignment="Stretch" MaxWidth="500" DockPanel.Dock="Bottom">
- <Button HorizontalAlignment="Left" Content="No" Classes="yesNo" Command="{TemplateBinding NoCommand}" />
- <Button HorizontalAlignment="Right" Content="Yes" Classes="action yesNo" IsDefault="True" Command="{TemplateBinding YesCommand}" />
+ <Button Name="PART_NoButton" HorizontalAlignment="Left" Content="No" Classes="yesNo" Command="{TemplateBinding NoCommand}" />
+ <Button Name="PART_YesButton" HorizontalAlignment="Right" Content="Yes" Classes="yesNo" IsDefault="True" Command="{TemplateBinding YesCommand}" />
</DockPanel>
<TextBlock Name="PART_Question"
Text="{TemplateBinding Text}"
</Setter>
</Style>
+ <Style Selector="c|QuestionControl">
+ <Setter Property="FontSize" Value="{StaticResource FontSizeH6}" />
+ </Style>
+
+ <!-- YesNo Button style -->
<Style Selector="Button.yesNo">
<Setter Property="Width" Value="150"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Padding" Value="0"/>
</Style>
- <Style Selector="c|QuestionControl">
- <Setter Property="FontSize" Value="{StaticResource FontSizeH6}" />
+ <!-- YesNo Button background -->
+ <Style Selector="c|QuestionControl[HighlightButton=NoButton] /template/ Button#PART_NoButton,
+ c|QuestionControl[HighlightButton=YesButton] /template/ Button#PART_YesButton,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_NoButton,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_YesButton">
+ <Setter Property="Background" Value="{DynamicResource ActionButtonBackgroundColor}" />
</Style>
+
+ <!-- YesNo Button pointerover -->
+ <Style Selector="c|QuestionControl[HighlightButton=YesButton] /template/ Button#PART_YesButton.yesNo:pointerover /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=NoButton] /template/ Button#PART_NoButton.yesNo:pointerover /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_NoButton.yesNo:pointerover /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_YesButton.yesNo:pointerover /template/ ContentPresenter">
+ <Setter Property="Background" Value="{StaticResource ActionButtonPointerOverBackgroundColor}" />
+ </Style>
+
+ <!-- YesNo Button pressed -->
+ <Style Selector="c|QuestionControl[HighlightButton=YesButton] /template/ Button#PART_YesButton.yesNo:pressed /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=NoButton] /template/ Button#PART_NoButton.yesNo:pressed /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_NoButton.yesNo:pressed /template/ ContentPresenter,
+ c|QuestionControl[HighlightButton=Both] /template/ Button#PART_YesButton.yesNo:pressed /template/ ContentPresenter">
+ <Setter Property="Background" Value="{StaticResource ActionButtonPressedBackgroundColor}" />
+ </Style>
+
</Styles>

MODIFY
WalletWasabi.Fluent/Controls/QuestionControl.axaml.cs
WalletWasabi.Fluent/Controls/QuestionControl.axaml.cs
@@ -5,6 +5,14 @@ using Avalonia.Media;
namespace WalletWasabi.Fluent.Controls
{
+ public enum HighlightedButton
+ {
+ None,
+ YesButton,
+ NoButton,
+ Both
+ }
+
public class QuestionControl : Label
{
public static readonly StyledProperty<ICommand> YesCommandProperty =
@@ -19,6 +27,9 @@ namespace WalletWasabi.Fluent.Controls
public static readonly StyledProperty<string> TextProperty =
AvaloniaProperty.Register<QuestionControl, string>(nameof(Text));
+ public static readonly StyledProperty<HighlightedButton> HighlightButtonProperty =
+ AvaloniaProperty.Register<QuestionControl, HighlightedButton>(nameof(HighlightButton));
+
public ICommand YesCommand
{
get => GetValue(YesCommandProperty);
@@ -42,5 +53,11 @@ namespace WalletWasabi.Fluent.Controls
get => GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
+
+ public HighlightedButton HighlightButton
+ {
+ get => GetValue(HighlightButtonProperty);
+ set => SetValue(HighlightButtonProperty, value);
+ }
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/HardwareWallet/DetectedHardwareWalletView.axaml
<c:QuestionControl Text="{Binding TypeName, StringFormat={}{0} was detected. Is this correct?}"
YesCommand="{Binding NextCommand}"
NoCommand="{Binding NoCommand}"
- Icon="{Binding Path='Type', Converter={x:Static conv:HardwareWalletIconConverter.Instance}}"/>
+ Icon="{Binding Path='Type', Converter={x:Static conv:HardwareWalletIconConverter.Instance}}"
+ HighlightButton="YesButton"/>
</c:ContentArea>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsNumbersView.axaml
<c:QuestionControl Text="Does your password contains numbers?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
- Icon="/Assets/PasswordFinder/numbers.png"/>
+ Icon="/Assets/PasswordFinder/numbers.png"
+ HighlightButton="Both"/>
</c:ContentArea>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
WalletWasabi.Fluent/Views/Login/PasswordFinder/ContainsSymbolsView.axaml
<c:QuestionControl Text="Does your password contains special characters?"
YesCommand="{Binding YesCommand}"
NoCommand="{Binding NoCommand}"
- Icon="/Assets/PasswordFinder/symbols.png"/>
+ Icon="/Assets/PasswordFinder/symbols.png"
+ HighlightButton="Both"/>
</c:ContentArea>
</UserControl>

QuestionControl highlight button