mirror of
https://github.com/Stone-Red-Code/InvLock.git
synced 2026-09-04 09:06:13 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a53be9abe | ||
|
|
f0dbf4621b | ||
|
|
beb6fce41a | ||
|
|
b065b90f87 | ||
|
|
a612e861d8 | ||
|
|
89bbabfcc5 |
@@ -0,0 +1,38 @@
|
||||
---
|
||||
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.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
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.
|
||||
; 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 MyAppVersion GetStringFileInfo("/publish/InvLock.exe","ProductVersion")
|
||||
#define MyAppVersion GetVersionNumbersString("/publish/InvLock.exe")
|
||||
#define MyAppPublisher "Stone_Red"
|
||||
#define MyAppExeName "InvLock.exe"
|
||||
|
||||
|
||||
Binary file not shown.
@@ -9,136 +9,6 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemesDictionary Theme="Dark" />
|
||||
<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>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -5,7 +5,6 @@ using InvLock.Utilities;
|
||||
using SharpHook.Native;
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
@@ -23,15 +22,7 @@ internal partial class MainWindowDataContext(Func<LockWindow?> lockWindowAccesso
|
||||
|
||||
public string AppName => App.AppName;
|
||||
|
||||
public string AppVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||
return fileVersionInfo.ProductVersion ?? "Unknown";
|
||||
}
|
||||
}
|
||||
public string AppVersion => Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
|
||||
|
||||
public Settings Settings { get; } = Settings.Load();
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
|
||||
<Version>1.1.0.20251229</Version>
|
||||
<AssemblyVersion>1.1.0.1229</AssemblyVersion>
|
||||
<FileVersion>1.1.0.20251229</FileVersion>
|
||||
<Version>1.1.0.0</Version>
|
||||
<AssemblyVersion>1.1.0.0</AssemblyVersion>
|
||||
<FileVersion>1.1.0.0</FileVersion>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public partial class LockWindow : Window
|
||||
MinimizeWindows();
|
||||
}
|
||||
|
||||
_ = Dispatcher.Invoke(async () =>
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
lastMousePosition = WpfScreenHelper.MouseHelper.MousePosition;
|
||||
|
||||
@@ -136,13 +136,10 @@ public partial class LockWindow : Window
|
||||
Height = bounds.Height,
|
||||
Left = bounds.Left,
|
||||
Top = bounds.Top,
|
||||
Topmost = true
|
||||
};
|
||||
|
||||
blurWindows.Add(blurWindow);
|
||||
blurWindow.Show();
|
||||
|
||||
blurWindow.Topmost = false;
|
||||
}
|
||||
|
||||
_ = WindowsApi.SetCursorPosition(new Point(100000, 100000));
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
WindowBackdropType="Mica"
|
||||
WindowCornerPreference="Round"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
WindowState="Minimized"
|
||||
Loaded="Window_Loaded"
|
||||
Closing="FluentWindow_Closing"
|
||||
Closed="FluentWindow_Closed"
|
||||
@@ -89,28 +90,28 @@
|
||||
<ui:TextBlock Grid.Row="1" Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}" FontSize="12" Text="Start InvLock when you sign in to Windows" />
|
||||
</Grid>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding IsAutoStartEnabled}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding IsAutoStartEnabled}" OffContent="Off" OnContent="On" />
|
||||
</ui:CardControl>
|
||||
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Window24}" Height="75">
|
||||
<ui:CardControl.Header>
|
||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Show desktop while locked" />
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.HideWindows}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.HideWindows}" OffContent="Off" OnContent="On" />
|
||||
</ui:CardControl>
|
||||
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=Blur24}" Height="75">
|
||||
<ui:CardControl.Header>
|
||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Blur screen while locked" />
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.BlurScreen}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.BlurScreen}" OffContent="Off" OnContent="On" />
|
||||
</ui:CardControl>
|
||||
|
||||
<ui:CardControl Margin="0,0,0,12" Icon="{ui:SymbolIcon Symbol=WindowShield24}" Height="75">
|
||||
<ui:CardControl.Header>
|
||||
<ui:TextBlock Grid.Row="0" FontTypography="Body" Text="Use windows lock screen to unlock" />
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.UseWindowsLockScreen}" Style="{StaticResource ToggleSwitchContentLeftStyle}" OffContent="Off" OnContent="On" />
|
||||
<ui:ToggleSwitch Grid.Column="1" IsChecked="{Binding Settings.UseWindowsLockScreen}" OffContent="Off" OnContent="On" />
|
||||
</ui:CardControl>
|
||||
|
||||
<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()
|
||||
{
|
||||
SystemThemeWatcher.Watch(this);
|
||||
|
||||
mainWindowDataContext = new MainWindowDataContext(() => lockWindow);
|
||||
DataContext = mainWindowDataContext;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
SystemThemeWatcher.Watch(this);
|
||||
}
|
||||
|
||||
internal void RestoreWindow()
|
||||
@@ -51,20 +51,10 @@ public partial class MainWindow : FluentWindow
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
|
||||
lockWindow = new LockWindow(mainWindowDataContext.Settings);
|
||||
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)
|
||||
|
||||
@@ -20,7 +20,6 @@ public class Settings : INotifyPropertyChanged
|
||||
private bool blurScreen = false;
|
||||
private string lockText = "Lock Screen Active";
|
||||
private string theme = "Windows default";
|
||||
private bool firstRun = true;
|
||||
private HashSet<KeyCode> lockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
||||
private HashSet<KeyCode> unlockShortcut = [KeyCode.VcLeftControl, KeyCode.VcLeftShift, KeyCode.VcL];
|
||||
|
||||
@@ -77,16 +76,6 @@ public class Settings : INotifyPropertyChanged
|
||||
}
|
||||
}
|
||||
|
||||
public bool FirstRun
|
||||
{
|
||||
get => firstRun;
|
||||
set
|
||||
{
|
||||
firstRun = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string LockShortcutText => string.Join(" + ", LockShortcut.Select(key => key.ToString()[2..]));
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Identity
|
||||
Name="StoneRed.9985F47BE4F2"
|
||||
Publisher="CN=6D1FD759-1951-428A-9B03-964461C7DBF5"
|
||||
Version="1.1.1.0" />
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<Properties>
|
||||
<DisplayName>InvLock</DisplayName>
|
||||
|
||||
Reference in New Issue
Block a user