Implement Lurking Wife mode toggle button
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
</MenuItem>
<MenuItem Header="Hide Address" Command="{Binding LockAddress}">
<MenuItem.Icon>
- <DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource ReceiveTabView_LockAddress}" />
+ <DrawingPresenter HorizontalAlignment="Left" Height="16" Width="16" Stretch="Fill" Drawing="{StaticResource EyesHide}" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerView.xaml
xmlns:ViewModels="clr-namespace:WalletWasabi.Gui.Controls.WalletExplorer;assembly=WalletWasabi.Gui"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:behaviors="clr-namespace:WalletWasabi.Gui.Behaviors;assembly=WalletWasabi.Gui"
+ xmlns:converters="clr-namespace:WalletWasabi.Gui.Converters;assembly=WalletWasabi.Gui"
x:Class="WalletWasabi.Gui.Controls.WalletExplorer.WalletExplorerView">
+ <UserControl.Resources>
+ <converters:BooleanStringConverter x:Key="BooleanStringConverter" />
+ </UserControl.Resources>
<UserControl.Styles>
<Style Selector="DrawingPresenter#PART_Spinner">
<Style.Animations>
<Button Background="Transparent" BorderThickness="0" ToolTip.Tip="Collapse All" Command="{Binding CollapseAllCommand}">
<DrawingPresenter Width="16" Height="16" Drawing="{DynamicResource WalletExplorerView_CollapseTree}" />
</Button>
-
- <Button Background="Transparent" BorderThickness="0" ToolTip.Tip="Lurking Wife Mode" Command="{Binding LurkingWifeModeCommand}">
- <DrawingPresenter Width="16" Height="16">
- <DrawingGroup>
- <GeometryDrawing Brush="#FFF0EFF1" Geometry="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z" />
- </DrawingGroup>
- </DrawingPresenter>
+ <Button Background="Transparent" BorderThickness="0" ToolTip.Tip="{Binding IsLurkingWifeMode, StringFormat=\{0\} Lurking Wife Mode, Converter={StaticResource BooleanStringConverter}, ConverterParameter=Disable:Enable}" Command="{Binding LurkingWifeModeCommand}">
+ <Panel>
+ <DrawingPresenter Width="16" Height="16" IsVisible="{Binding IsLurkingWifeMode}" Drawing="{DynamicResource EyesShow}" />
+ <DrawingPresenter Width="16" Height="16" IsVisible="{Binding !IsLurkingWifeMode}" Drawing="{DynamicResource EyesHide}" />
+ </Panel>
</Button>
</StackPanel>
</Panel>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletExplorerViewModel.cs
+using System.Security.Cryptography.X509Certificates;
using System;
using AvalonStudio.Extensibility;
using AvalonStudio.MVVM;
@@ -27,6 +28,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private Dictionary<Wallet, WalletViewModelBase> _walletDictionary;
public override Location DefaultLocation => Location.Right;
+ public bool IsLurkingWifeMode => _isLurkingWifeMode?.Value ?? false;
+ private ObservableAsPropertyHelper<bool> _isLurkingWifeMode;
public WalletExplorerViewModel()
{
@@ -38,6 +41,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
WalletManager = Locator.Current.GetService<Global>().WalletManager;
+ UiConfig = Locator.Current.GetService<Global>().UiConfig;
+
Observable.FromEventPattern<WalletState>(WalletManager, nameof(WalletManager.WalletStateChanged))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x =>
@@ -67,11 +72,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
LurkingWifeModeCommand = ReactiveCommand.CreateFromTask(async () =>
{
- var uiConfig = Locator.Current.GetService<Global>().UiConfig;
- uiConfig.LurkingWifeMode = !uiConfig.LurkingWifeMode;
- uiConfig.ToFile();
+ UiConfig.LurkingWifeMode = !UiConfig.LurkingWifeMode;
+ UiConfig.ToFile();
});
+ _isLurkingWifeMode = UiConfig.WhenAnyValue(x => x.LurkingWifeMode)
+ .ToProperty(this, x => x.IsLurkingWifeMode, scheduler: RxApp.MainThreadScheduler);
+
LurkingWifeModeCommand.ThrownExceptions
.ObserveOn(RxApp.TaskpoolScheduler)
.Subscribe(ex => Logger.LogError(ex));
@@ -96,6 +103,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
private WalletManager WalletManager { get; }
+ private UiConfig UiConfig { get; }
public ObservableCollection<WalletViewModelBase> Wallets
{

MODIFY
WalletWasabi.Gui/Icons/Icons.xaml
WalletWasabi.Gui/Icons/Icons.xaml
<DrawingGroup x:Key="ReceiveTabView_IsHardwareWallet">
<GeometryDrawing Brush="#22B14C" Geometry="F1 M 23.5,45.5L 30,52L 40.5,41.5L 44,45L 30,59L 20,49L 23.5,45.5 Z M 20,17L 43.25,17L 56,29.75L 56,59L 32,59L 36,55L 52,55L 52,34L 39,34L 39,21L 24,21L 24,43L 20,47L 20,17 Z M 20,59L 20,51L 28,59L 20,59 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z" />
</DrawingGroup>
- <DrawingGroup x:Key="ReceiveTabView_LockAddress">
+
+ <!-- Anonymity icons -->
+ <DrawingGroup x:Key="EyesHide">
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FF252526" Geometry="F1M16,10L12.121,10 14.768,12.646 12.646,14.768 9.548,11.669C8.448,12.137 7.154,12.117 6.035,11.479 5.418,11.128 4.908,10.616 4.556,10L0,10 0,9C0,7.076,0.68,5.312,1.811,3.932L0.231999999999999,2.354 2.354,0.231999999999999 4.125,2.003C5.273,1.366 6.593,1 8,1 12.418,1 16,4.582 16,9z" />
<GeometryDrawing Brush="#FFC4C4C4" Geometry="F1M9.0127,9.7197L6.2807,6.9877C6.1027,7.2837 5.9997,7.6287 5.9997,7.9997 5.9997,9.1047 6.8957,9.9997 7.9997,9.9997 8.3707,9.9997 8.7167,9.8967 9.0127,9.7197 M10.4407,9.7337L13.3537,12.6467 12.6467,13.3537 9.7207,10.4277C9.2327,10.7777 8.6467,10.9997 7.9997,10.9997 6.3437,10.9997 4.9997,9.6577 4.9997,7.9997 4.9997,7.3527 5.2227,6.7677 5.5727,6.2797L3.9157,4.6227C2.7417,5.7177,1.9997,7.2687,1.9997,8.9997L0.999700000000001,8.9997C0.999700000000001,6.9917,1.8537,5.1907,3.2077,3.9147L1.6467,2.3537 2.3537,1.6467 3.9817,3.2747 3.9847,3.2717 4.7027,3.9897C4.7017,3.9907,4.7007,3.9917,4.6997,3.9917L6.2657,5.5587C6.2677,5.5587,6.2677,5.5567,6.2697,5.5567L6.9937,6.2807C6.9927,6.2817,6.9917,6.2827,6.9907,6.2827L9.7167,9.0097C9.7177,9.0087,9.7187,9.0077,9.7187,9.0057L10.4437,9.7307z M7.9997,1.9997C6.8737,1.9997,5.8137,2.2727,4.8717,2.7447L5.6197,3.4927C6.3497,3.1767 7.1537,2.9997 7.9997,2.9997 11.3137,2.9997 13.9997,5.6867 13.9997,8.9997L14.9997,8.9997C14.9997,5.1337,11.8667,1.9997,7.9997,1.9997 M8.1407,6.0137L7.2377,5.1107C7.4817,5.0457 7.7347,4.9997 7.9997,4.9997 9.6577,4.9997 10.9997,6.3437 10.9997,7.9997 10.9997,8.2647 10.9547,8.5177 10.8897,8.7627L9.9857,7.8587C9.9147,6.8687,9.1307,6.0847,8.1407,6.0137" />
</DrawingGroup.Children>
</DrawingGroup>
-
- <!-- Anonymity icons -->
+ <DrawingGroup x:Key="EyesShow">
+ <DrawingGroup.Children>
+ <GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
+ <GeometryDrawing Brush="#FF252526" Geometry="M 7.7695312 0.99023438 C 5.7973867 1.0503417 3.928221 1.8584606 2.515625 3.1855469 1.6194204 3.9394845 0.89857582 4.9760806 0.4609375 6.3320312 0.28057192 6.8474512 0.14630256 7.387891 0.07421875 7.9550781 0.06860062 7.9969838 0.05964164 8.0380538 0.0546875 8.0800781 0.02123731 8.3809198 -6.5438969e-5 8.6867158 0 9 v 1 h 4.5566406 c 0.7619511 1.278191 1.9302386 1.801135 3.3281249 1.976546 0.00721 1.86e-4 0.014275 0.0018 0.021484 0.002 C 9.3305307 11.993549 10.82203 11.052515 11.443359 10 H 12.671875 16 V 9 c 6.5e-5 -0.3132842 -0.02124 -0.6190802 -0.05469 -0.9199219 -0.005 -0.042024 -0.01391 -0.083094 -0.01953 -0.125 C 15.414585 3.932759 12.001075 1.1051554 8.2304688 0.99023438 c -0.1702127 -0.002154 -0.3135497 0 -0.4609376 0 z" />
+ <GeometryDrawing Brush="#FFC4C4C4" Geometry="M 7.9648438 2 C 4.0988507 2 0.96484375 5.134007 0.96484375 9 L 1.9648438 9 C 1.9652917 5.537785 4.8118749 2.989855 7.9824219 3 C 11.152967 2.98986 13.999552 5.537785 14 9 L 15 9 C 15 5.134007 11.865993 2 8 2 C 7.98808 2.0069 7.9762137 2 7.9648438 2 z M 7.9980469 5.0429688 C 6.3667289 5.0429688 5.0332031 6.3764945 5.0332031 8.0078125 C 5.0332031 9.6391305 6.3667289 10.970703 7.9980469 10.970703 C 9.6293649 10.970703 10.960938 9.6391305 10.960938 8.0078125 C 10.960938 6.3764945 9.6293649 5.0429688 7.9980469 5.0429688 z M 7.9980469 5.9804688 C 9.1229079 5.9804688 10.023438 6.8829515 10.023438 8.0078125 C 10.023438 9.1326735 9.1229079 10.033203 7.9980469 10.033203 C 6.8731859 10.033203 5.9707031 9.1326735 5.9707031 8.0078125 C 5.9707031 6.8829515 6.8731859 5.9804687 7.9980469 5.9804688 z " />
+ </DrawingGroup.Children>
+ </DrawingGroup>
<DrawingGroup x:Key="PrivacyCritical">
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />

Implement Lurking Wife mode toggle button