mirror of
https://github.com/Stone-Red-Code/InvLock.git
synced 2026-09-04 09:06:13 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0add98255 | ||
|
|
81c8d9e315 | ||
|
|
d5e00c29ef | ||
|
|
1d02db6bba | ||
|
|
ceb55ad49f | ||
|
|
5e8d5afe1b | ||
|
|
99715ded8b | ||
|
|
0f62873c3d |
@@ -1,38 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
---
|
|
||||||
name: Feature request
|
|
||||||
about: Suggest an idea for this project
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
; Script generated by the Inno Setup Script Wizard.
|
; Script generated by the Inno Setup Script Wizard.
|
||||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||||
|
|
||||||
#expr Exec('cmd.exe /C', 'dotnet build -o "' + SourcePath + '\publish" -c Release ' + SourcePath + '..\src\InvLock\')
|
#expr Exec('cmd.exe', '/C dotnet build -o "' + SourcePath + '\publish" -c Release ' + SourcePath + '..\src\InvLock\')
|
||||||
|
|
||||||
#define MyAppName "InvLock"
|
#define MyAppName "InvLock"
|
||||||
#define MyAppVersion GetVersionNumbersString("/publish/InvLock.exe")
|
#define MyAppVersion GetStringFileInfo("/publish/InvLock.exe","ProductVersion")
|
||||||
#define MyAppPublisher "Stone_Red"
|
#define MyAppPublisher "Stone_Red"
|
||||||
#define MyAppExeName "InvLock.exe"
|
#define MyAppExeName "InvLock.exe"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -9,6 +9,136 @@
|
|||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ui:ThemesDictionary Theme="Dark" />
|
<ui:ThemesDictionary Theme="Dark" />
|
||||||
<ui:ControlsDictionary />
|
<ui:ControlsDictionary />
|
||||||
|
<ResourceDictionary
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=System.Runtime">
|
||||||
|
|
||||||
|
<system:Double x:Key="ToggleButtonWidth">40</system:Double>
|
||||||
|
<system:Double x:Key="ToggleButtonHeight">20</system:Double>
|
||||||
|
<Thickness x:Key="ToggleSwitchBorderThemeThickness">1</Thickness>
|
||||||
|
<Thickness x:Key="ToggleSwitchContentLeftMargin">0,0,8,0</Thickness>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleSwitchContentLeftStyle" TargetType="{x:Type ui:ToggleSwitch}">
|
||||||
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOn}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchContentForeground}" />
|
||||||
|
<Setter Property="BorderBrush" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="{StaticResource ToggleSwitchBorderThemeThickness}" />
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center" />
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||||
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ui:ToggleSwitch}">
|
||||||
|
<Grid Margin="{TemplateBinding Padding}" Background="Transparent">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ContentPresenter
|
||||||
|
x:Name="ContentPresenter"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="{StaticResource ToggleSwitchContentLeftMargin}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
|
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||||
|
|
||||||
|
<Grid
|
||||||
|
Grid.Column="1"
|
||||||
|
Width="{StaticResource ToggleButtonWidth}"
|
||||||
|
Height="{StaticResource ToggleButtonHeight}">
|
||||||
|
<Rectangle
|
||||||
|
x:Name="ToggleRectangle"
|
||||||
|
Width="{StaticResource ToggleButtonWidth}"
|
||||||
|
Height="{StaticResource ToggleButtonHeight}"
|
||||||
|
Fill="{DynamicResource ToggleSwitchFillOff}"
|
||||||
|
RadiusX="10" RadiusY="10"
|
||||||
|
Stroke="{DynamicResource ToggleSwitchStrokeOff}"
|
||||||
|
StrokeThickness="1" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="ActiveToggleRectangle"
|
||||||
|
Width="{StaticResource ToggleButtonWidth}"
|
||||||
|
Height="{StaticResource ToggleButtonHeight}"
|
||||||
|
Fill="{TemplateBinding Background}"
|
||||||
|
Opacity="0.0"
|
||||||
|
RadiusX="10" RadiusY="10" />
|
||||||
|
<Rectangle
|
||||||
|
x:Name="ToggleEllipse"
|
||||||
|
Width="12" Height="12"
|
||||||
|
Fill="{DynamicResource ToggleSwitchKnobFillOff}"
|
||||||
|
RadiusX="7" RadiusY="7">
|
||||||
|
<Rectangle.RenderTransform>
|
||||||
|
<TranslateTransform X="-9" />
|
||||||
|
</Rectangle.RenderTransform>
|
||||||
|
</Rectangle>
|
||||||
|
<Rectangle
|
||||||
|
x:Name="ActiveToggleEllipse"
|
||||||
|
Width="12" Height="12"
|
||||||
|
Fill="{DynamicResource ToggleSwitchKnobFillOn}"
|
||||||
|
Opacity="0.0"
|
||||||
|
RadiusX="7" RadiusY="7">
|
||||||
|
<Rectangle.RenderTransform>
|
||||||
|
<TranslateTransform X="-9" />
|
||||||
|
</Rectangle.RenderTransform>
|
||||||
|
</Rectangle>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsChecked" Value="True">
|
||||||
|
<Trigger.EnterActions>
|
||||||
|
<BeginStoryboard Name="SlideRight">
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ToggleRectangle" Storyboard.TargetProperty="Opacity" To="0.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleRectangle" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ToggleEllipse" Storyboard.TargetProperty="Opacity" To="0.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleEllipse" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleEllipse" Storyboard.TargetProperty="(Rectangle.RenderTransform).(TranslateTransform.X)" To="9" Duration="0:0:0.167" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.EnterActions>
|
||||||
|
<Trigger.ExitActions>
|
||||||
|
<BeginStoryboard>
|
||||||
|
<Storyboard>
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ToggleRectangle" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleRectangle" Storyboard.TargetProperty="Opacity" To="0.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ToggleEllipse" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleEllipse" Storyboard.TargetProperty="Opacity" To="0.0" Duration="0:0:0.16" />
|
||||||
|
<DoubleAnimation Storyboard.TargetName="ActiveToggleEllipse" Storyboard.TargetProperty="(Rectangle.RenderTransform).(TranslateTransform.X)" To="-9" Duration="0:0:0.167" />
|
||||||
|
</Storyboard>
|
||||||
|
</BeginStoryboard>
|
||||||
|
</Trigger.ExitActions>
|
||||||
|
</Trigger>
|
||||||
|
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Content" Value="{x:Null}" />
|
||||||
|
<Condition Property="IsChecked" Value="True" />
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
<Setter TargetName="ContentPresenter" Property="Content" Value="{Binding OnContent, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="Content" Value="{x:Null}" />
|
||||||
|
<Condition Property="IsChecked" Value="False" />
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
<Setter TargetName="ContentPresenter" Property="Content" Value="{Binding OffContent, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||||
|
</MultiTrigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using InvLock.Utilities;
|
|||||||
using SharpHook.Native;
|
using SharpHook.Native;
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
@@ -22,7 +23,15 @@ internal partial class MainWindowDataContext(Func<LockWindow?> lockWindowAccesso
|
|||||||
|
|
||||||
public string AppName => App.AppName;
|
public string AppName => App.AppName;
|
||||||
|
|
||||||
public string AppVersion => Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
|
public string AppVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||||
|
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||||
|
return fileVersionInfo.ProductVersion ?? "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Settings Settings { get; } = Settings.Load();
|
public Settings Settings { get; } = Settings.Load();
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
|
||||||
<Version>1.1.0.0</Version>
|
<Version>1.1.0.20251229</Version>
|
||||||
<AssemblyVersion>1.1.0.0</AssemblyVersion>
|
<AssemblyVersion>1.1.0.1229</AssemblyVersion>
|
||||||
<FileVersion>1.1.0.0</FileVersion>
|
<FileVersion>1.1.0.20251229</FileVersion>
|
||||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public partial class LockWindow : Window
|
|||||||
MinimizeWindows();
|
MinimizeWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.Invoke(() =>
|
_ = Dispatcher.Invoke(async () =>
|
||||||
{
|
{
|
||||||
lastMousePosition = WpfScreenHelper.MouseHelper.MousePosition;
|
lastMousePosition = WpfScreenHelper.MouseHelper.MousePosition;
|
||||||
|
|
||||||
@@ -136,10 +136,13 @@ public partial class LockWindow : Window
|
|||||||
Height = bounds.Height,
|
Height = bounds.Height,
|
||||||
Left = bounds.Left,
|
Left = bounds.Left,
|
||||||
Top = bounds.Top,
|
Top = bounds.Top,
|
||||||
|
Topmost = true
|
||||||
};
|
};
|
||||||
|
|
||||||
blurWindows.Add(blurWindow);
|
blurWindows.Add(blurWindow);
|
||||||
blurWindow.Show();
|
blurWindow.Show();
|
||||||
|
|
||||||
|
blurWindow.Topmost = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = WindowsApi.SetCursorPosition(new Point(100000, 100000));
|
_ = WindowsApi.SetCursorPosition(new Point(100000, 100000));
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
WindowBackdropType="Mica"
|
WindowBackdropType="Mica"
|
||||||
WindowCornerPreference="Round"
|
WindowCornerPreference="Round"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
WindowState="Minimized"
|
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
Closing="FluentWindow_Closing"
|
Closing="FluentWindow_Closing"
|
||||||
Closed="FluentWindow_Closed"
|
Closed="FluentWindow_Closed"
|
||||||
@@ -90,28 +89,28 @@
|
|||||||
<ui:TextBlock Grid.Row="1" Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" FontSize="12" Text="Start InvLock when you sign in to Windows" />
|
<ui:TextBlock Grid.Row="1" Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" FontSize="12" Text="Start InvLock when you sign in to Windows" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding IsAutoStartEnabled}" OffContent="Off" OnContent="On" />
|
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding IsAutoStartEnabled}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
|
||||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Window24}" Height="75">
|
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Window24}" Height="75">
|
||||||
<ui:CardControl.Header>
|
<ui:CardControl.Header>
|
||||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Show desktop while locked" />
|
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Show desktop while locked" />
|
||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.HideWindows}" OffContent="Off" OnContent="On" />
|
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.HideWindows}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
|
||||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Blur24}" Height="75">
|
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Blur24}" Height="75">
|
||||||
<ui:CardControl.Header>
|
<ui:CardControl.Header>
|
||||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Blur screen while locked" />
|
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Blur screen while locked" />
|
||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.BlurScreen}" OffContent="Off" OnContent="On" />
|
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.BlurScreen}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
|
||||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=WindowShield24}" Height="75">
|
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=WindowShield24}" Height="75">
|
||||||
<ui:CardControl.Header>
|
<ui:CardControl.Header>
|
||||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Use windows lock screen to unlock" />
|
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Use windows lock screen to unlock" />
|
||||||
</ui:CardControl.Header>
|
</ui:CardControl.Header>
|
||||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.UseWindowsLockScreen}" OffContent="Off" OnContent="On" />
|
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.UseWindowsLockScreen}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||||
</ui:CardControl>
|
</ui:CardControl>
|
||||||
|
|
||||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=LockClosed24}" Height="75">
|
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=LockClosed24}" Height="75">
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ public partial class MainWindow : FluentWindow
|
|||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
SystemThemeWatcher.Watch(this);
|
||||||
|
|
||||||
mainWindowDataContext = new MainWindowDataContext(() => lockWindow);
|
mainWindowDataContext = new MainWindowDataContext(() => lockWindow);
|
||||||
DataContext = mainWindowDataContext;
|
DataContext = mainWindowDataContext;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
SystemThemeWatcher.Watch(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void RestoreWindow()
|
internal void RestoreWindow()
|
||||||
@@ -51,10 +51,20 @@ public partial class MainWindow : FluentWindow
|
|||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Close();
|
|
||||||
|
|
||||||
lockWindow = new LockWindow(mainWindowDataContext.Settings);
|
lockWindow = new LockWindow(mainWindowDataContext.Settings);
|
||||||
lockWindow.Show();
|
lockWindow.Show();
|
||||||
|
|
||||||
|
if (mainWindowDataContext.Settings.FirstRun)
|
||||||
|
{
|
||||||
|
mainWindowDataContext.Settings.FirstRun = false;
|
||||||
|
RestoreWindow();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowInTaskbar = false;
|
||||||
|
WindowState = WindowState.Minimized;
|
||||||
|
Visibility = Visibility.Collapsed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NotifyIcon_LeftClick(Wpf.Ui.Tray.Controls.NotifyIcon sender, RoutedEventArgs e)
|
private void NotifyIcon_LeftClick(Wpf.Ui.Tray.Controls.NotifyIcon sender, RoutedEventArgs e)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class Settings : INotifyPropertyChanged
|
|||||||
private bool blurScreen = false;
|
private bool blurScreen = false;
|
||||||
private string lockText = "Lock Screen Active";
|
private string lockText = "Lock Screen Active";
|
||||||
private string theme = "Windows default";
|
private string theme = "Windows default";
|
||||||
|
private bool firstRun = true;
|
||||||
private HashSet<KeyCode> lockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
private HashSet<KeyCode> lockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
||||||
private HashSet<KeyCode> unlockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
private HashSet<KeyCode> unlockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
||||||
|
|
||||||
@@ -76,6 +77,16 @@ public class Settings : INotifyPropertyChanged
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool FirstRun
|
||||||
|
{
|
||||||
|
get => firstRun;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
firstRun = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public string LockShortcutText => string.Join(" + ", LockShortcut.Select(key => key.ToString()[2..]));
|
public string LockShortcutText => string.Join(" + ", LockShortcut.Select(key => key.ToString()[2..]));
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<Identity
|
<Identity
|
||||||
Name="StoneRed.9985F47BE4F2"
|
Name="StoneRed.9985F47BE4F2"
|
||||||
Publisher="CN=6D1FD759-1951-428A-9B03-964461C7DBF5"
|
Publisher="CN=6D1FD759-1951-428A-9B03-964461C7DBF5"
|
||||||
Version="1.0.0.0" />
|
Version="1.1.1.0" />
|
||||||
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<DisplayName>InvLock</DisplayName>
|
<DisplayName>InvLock</DisplayName>
|
||||||
|
|||||||
Reference in New Issue
Block a user