Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen Lock implementation #1681

Merged
merged 71 commits into from Jul 23, 2019
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d6a25e7
Initial Implementation of Lock Screens.
jmacato Jul 1, 2019
c30192f
Cont'd implementation of slide lock..
jmacato Jul 2, 2019
f978386
Fix indent.
jmacato Jul 2, 2019
f1aa8c2
Add "Lock Screen" menu item
jmacato Jul 2, 2019
880e21e
Change easing to Quadtratic.
jmacato Jul 2, 2019
4030359
Add necessary UiConfig fields.
jmacato Jul 2, 2019
2fc2460
fix LockScreenCommands.
jmacato Jul 2, 2019
bb31fd2
Added LockScreenViewModel and a Simple lock screen for debugging purp…
jmacato Jul 2, 2019
be045df
Made the simple lock work
jmacato Jul 2, 2019
17ea5b4
Some fixes to SimpleLock
jmacato Jul 2, 2019
f3c26de
Fix lock screen persistence.
jmacato Jul 3, 2019
4419641
Basic infra for shuttling changes from UiConfig to Screen locks is done.
jmacato Jul 3, 2019
cb3f5af
Stray newline
jmacato Jul 3, 2019
8b09321
Fix codefactor issues
jmacato Jul 3, 2019
c9d5fb5
Fix SlideLock and add initial PINLock skeleton code.
jmacato Jul 3, 2019
29d559a
Disable menu when screenlocked.
jmacato Jul 3, 2019
5bd615f
Fix slidelock hittest
jmacato Jul 3, 2019
a580e2b
Implement PIN verification
jmacato Jul 3, 2019
bd7d301
Fix buggy hit testing.
jmacato Jul 6, 2019
6227694
Scaffold settings controls for screen lock
jmacato Jul 6, 2019
a46c983
Make better logic for handling PIN hash and determining what screen l…
jmacato Jul 7, 2019
d58ab23
More work on screen lock settings.
jmacato Jul 7, 2019
997c61d
Try adding validation on PIN entry
jmacato Jul 7, 2019
b3ce973
Remove unused SimpleLock.
jmacato Jul 11, 2019
7e45225
Rename LockScreenImpl to LockScreenBase since the former's name doesn…
jmacato Jul 11, 2019
4c77274
Fix CodeFactor issues.
jmacato Jul 11, 2019
98bb140
Fix merge conflicts from upstream.
jmacato Jul 11, 2019
efb4144
Use Observables for drag events.
jmacato Jul 11, 2019
fb75746
make LockScreen class public and rename lockscreenimpl.
jmacato Jul 13, 2019
f921429
Set Guard
jmacato Jul 13, 2019
ae7079e
Observe on main thread.
jmacato Jul 13, 2019
70be4a6
Convert 4spaces to tab
jmacato Jul 13, 2019
edaa175
Observe on main thread part 2.
jmacato Jul 13, 2019
67646d6
Update binding.
jmacato Jul 16, 2019
cf10e3e
PIN settings now fully functional.
jmacato Jul 16, 2019
2dd952c
Moving to MVVM part 1.
jmacato Jul 16, 2019
700d46d
Reimplemented locks as DataTemplates to abide more to MVVM principles…
jmacato Jul 17, 2019
7068232
Fix tabs and address CodeFactor issues.
jmacato Jul 17, 2019
1b54f66
Slide lock fully functional.
jmacato Jul 17, 2019
494bd10
Merge branch 'master' into pr/1681-screen-lock-implementation
nopara73 Jul 17, 2019
b2e40e6
CodeMaid
nopara73 Jul 17, 2019
a82c12e
Address review in SlideLock.
jmacato Jul 17, 2019
774f48e
Remove throttle in Pin lock check.
jmacato Jul 17, 2019
c886323
Add numbers on pin keypad
jmacato Jul 17, 2019
efe4cff
Only allow numbers on PIN entry.
jmacato Jul 17, 2019
f4e20ce
Address CodeFactor.
jmacato Jul 17, 2019
754ce6d
Focus on PIN input when locked;
jmacato Jul 17, 2019
925fbdb
Make SlideLock slide up when unlocking. Add a visual indicator below …
jmacato Jul 20, 2019
1c6cb9d
Merge branch 'master' into lockscreen-impl
nopara73 Jul 22, 2019
c259717
CodeMaid
nopara73 Jul 22, 2019
3bd8bee
fix xaml
nopara73 Jul 22, 2019
a358d1e
Make PIN capitalization C#-i.
nopara73 Jul 22, 2019
ce01bdb
Implement PIN settings properly.
nopara73 Jul 22, 2019
634b1fa
Put lockscreencommand into exitcommands
nopara73 Jul 22, 2019
8d0b10c
Simplify exception catching
nopara73 Jul 22, 2019
b547072
Change exit group to system group
nopara73 Jul 22, 2019
cbeba64
Exit1
nopara73 Jul 22, 2019
439fef5
cleanup trash
nopara73 Jul 22, 2019
a758c6a
CodeMaid
molnard Jul 22, 2019
0eadefe
Code clean
molnard Jul 23, 2019
7094fc7
Code clean
molnard Jul 23, 2019
ca2ea3b
Fix bug with Back button
molnard Jul 23, 2019
d17b4f6
Set the focus of passwordbox after app start.
molnard Jul 23, 2019
af1a414
Do not change focus on buttonpress.
molnard Jul 23, 2019
ce228eb
nitpicking
nopara73 Jul 23, 2019
25cebb5
Use Exit string on menuItem instead of Exi1
molnard Jul 23, 2019
8c14f17
Update comment
nopara73 Jul 23, 2019
bd8fa2a
Fix type fast => no validation
molnard Jul 23, 2019
8dd62f5
Fix mac deadlock.
molnard Jul 23, 2019
4dec275
Move Lock Screen button out of MainMenu
molnard Jul 23, 2019
5f8aa8a
Fix default order
molnard Jul 23, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,5 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<lockscreen:SlideLock/>
</UserControl>
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace WalletWasabi.Gui.Controls.LockScreen
{
internal class LockScreen : UserControl
{
public LockScreen()
{
InitializeComponent();
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
@@ -0,0 +1,16 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<UserControl.Clock>
<Clock/>
</UserControl.Clock>
<Grid>
<Thumb x:Name="PART_DragThumb">
<Thumb.Template>
<ControlTemplate>
<Border Background="Blue"/>
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Grid>
</UserControl>
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using Avalonia.Media;
using Avalonia.Input;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Controls.Primitives;

namespace WalletWasabi.Gui.Controls.LockScreen
{
internal class SlideLock : UserControl
{
private Thumb DragThumb;
private TranslateTransform DragThumbTransform;
private bool UnlockInProgress = false;

private double _offset = 0;
private double Offset
{
get => _offset;
set => OnOffsetChanged(value);
}

private const double Stiffness = 0.12d;

public SlideLock()
{
InitializeComponent();

this.DragThumb = this.FindControl<Thumb>("PART_DragThumb");
DragThumbTransform = new TranslateTransform();
This conversation was marked as resolved by jmacato

This comment has been minimized.

Copy link
@lontivero

lontivero Jul 1, 2019

Collaborator

Review the indentation.


DragThumb.DragCompleted += OnDragCompleted;
This conversation was marked as resolved by nopara73

This comment has been minimized.

Copy link
@nopara73

nopara73 Jul 11, 2019

Collaborator

Don't subscribe to events on the GUI project. Make them observable with RX and make sure you're unsubscribing with disposewith. Sth like Observable.CreateFromEvent.

DragThumb.DragDelta += OnDragDelta;
DragThumb.DragStarted += OnDragStarted;
DragThumb.RenderTransform = DragThumbTransform;

Clock.Subscribe(OnClockTick);
}

private void OnOffsetChanged(double value)
{
_offset = value;
DragThumbTransform.Y = _offset;
}

private void OnClockTick(TimeSpan CurrentTime)
{
if (!UnlockInProgress & Offset != 0)
{
Offset *= 1 - Stiffness;
}
}

private void OnDragStarted(object sender, VectorEventArgs e)
{
UnlockInProgress = true;
}

private void OnDragDelta(object sender, VectorEventArgs e)
{
if (e.Vector.Y < 0)
this.Offset = e.Vector.Y;
}

private void OnDragCompleted(object sender, VectorEventArgs e)
{
UnlockInProgress = false;
}

private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}
@@ -1,6 +1,7 @@
<cont:MetroWindow xmlns="https://github.com/avaloniaui"
xmlns:cont="clr-namespace:AvalonStudio.Shell.Controls;assembly=AvalonStudio.Shell"
xmlns:wasabi="clr-namespace:WalletWasabi.Gui.Controls;assembly=WalletWasabi.Gui"
xmlns:lockscreen="clr-namespace:WalletWasabi.Gui.Controls.LockScreen;assembly=WalletWasabi.Gui"
xmlns:behaviors="clr-namespace:WalletWasabi.Gui.Behaviors;assembly=WalletWasabi.Gui"
xmlns:shell="clr-namespace:AvalonStudio.Shell;assembly=AvalonStudio.Shell"
xmlns:menu="clr-namespace:AvalonStudio.Shell.Extensibility.MainMenu.Views;assembly=AvalonStudio.Shell.Extensibility"
@@ -37,5 +38,6 @@
<shell:ShellView DataContext="{Binding Shell}" />
</DockPanel>
<wasabi:ModalDialog DataContext="{Binding ModalDialog}" />
<lockscreen:LockScreen/>
</Grid>
</cont:MetroWindow>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.