-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
323 lines (294 loc) · 20 KB
/
MainWindow.xaml
File metadata and controls
323 lines (294 loc) · 20 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<Window x:Class="ZeroInput.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ZeroInput"
mc:Ignorable="d"
Title="ZeroInput" Height="500" Width="800"
MinHeight="500" MinWidth="800" ResizeMode="CanMinimize"
Icon="pack://application:,,,/ZeroInput;component/ZeroInput.ico"
WindowStartupLocation="CenterScreen"
Background="#1E1E1E" Foreground="#E0E0E0">
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Background" Value="#333"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#555"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ToggleButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsProtectionActive}" Value="True">
<Setter Property="Background" Value="#00BFA5"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontWeight" Value="Bold"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsProtectionActive}" Value="False">
<Setter Property="Background" Value="#D32F2F"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="TabItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Name="Border" Background="Transparent" Margin="0,0,5,0" CornerRadius="4,4,0,0" Padding="15,10">
<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="10,2"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="#252525" />
<Setter Property="Foreground" Value="#00BFA5" />
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Foreground" Value="#888" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
</Window.Resources>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<Image Source="ZeroInput.ico" Width="48" Height="48" Margin="0,0,15,0" RenderOptions.BitmapScalingMode="HighQuality"/>
<StackPanel VerticalAlignment="Center">
<TextBlock Text="ZERO INPUT" FontSize="24" FontWeight="Bold" Foreground="#00BFA5"/>
<TextBlock Text="Advanced Input Blocking Utility" FontSize="12" Foreground="#888"/>
</StackPanel>
</StackPanel>
<Button Grid.Column="1" Command="{Binding ToggleProtectionCommand}" Style="{StaticResource ToggleButtonStyle}" Width="150" Height="40">
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsProtectionActive}" Value="True">
<Setter Property="Text" Value="PROTECTION: ON"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsProtectionActive}" Value="False">
<Setter Property="Text" Value="PROTECTION: OFF"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Button>
</Grid>
<TabControl Grid.Row="1" Background="Transparent" BorderThickness="0">
<TabItem Header="RULES">
<Grid Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="#333" BorderThickness="1" Background="#252525" CornerRadius="4">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding Rules}" SelectedItem="{Binding SelectedRule, Mode=TwoWay}" Background="Transparent" BorderThickness="0" Foreground="White" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding DisplayString}" VerticalAlignment="Center" Padding="5,0"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding IsActive}"
VerticalAlignment="Center"
Margin="10,0,15,0">
<CheckBox.Style>
<Style TargetType="CheckBox">
<Setter Property="Content" Value="Off"/>
<Setter Property="Foreground" Value="#666666"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Content" Value="On"/>
<Setter Property="Foreground" Value="#00BFA5"/>
<Setter Property="FontWeight" Value="SemiBold"/>
</Trigger>
</Style.Triggers>
</Style>
</CheckBox.Style>
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
</CheckBox.LayoutTransform>
</CheckBox>
<Button Grid.Column="2" Content="✕"
Width="24" Height="24"
Background="Transparent"
Foreground="#666"
FontSize="12"
Padding="0"
Command="{Binding DataContext.RemoveRuleCommand, RelativeSource={RelativeSource AncestorType=Window}}"
CommandParameter="{Binding}">
<Button.Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="12">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#D32F2F"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Grid.Row="1" Command="{Binding AddRuleCommand}" Content="+ New Rule" Background="#333" Height="17"/>
</Grid>
</Border>
<Grid Grid.Column="1" Margin="20,0,0,0">
<TextBlock Text="Select a rule to edit" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#555" IsHitTestVisible="False"/>
<Border Background="#252525" CornerRadius="4" Padding="20" DataContext="{Binding SelectedRule}">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Visible"/>
<Style.Triggers>
<DataTrigger Binding="{Binding}" Value="{x:Null}">
<Setter Property="Visibility" Value="Hidden"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<TextBlock Text="RULE SETTINGS" Foreground="#888" FontWeight="Bold" Margin="0,0,0,15"/>
<TextBlock Text="Name" Margin="0,5"/>
<TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}" Padding="5" Background="#333" Foreground="White" BorderThickness="0"/>
<TextBlock Text="Trigger Key" Margin="0,15,0,5"/>
<ComboBox ItemsSource="{Binding DataContext.AllKeys, RelativeSource={RelativeSource AncestorType=Window}}" SelectedItem="{Binding Key, UpdateSourceTrigger=PropertyChanged}" Padding="5"/>
<TextBlock Text="Required Modifiers" Margin="0,15,0,5"/>
<StackPanel Orientation="Horizontal" Margin="0,5">
<CheckBox IsChecked="{Binding IsCtrlRequired}" Content="Ctrl" Foreground="White" Margin="0,0,15,0"/>
<CheckBox IsChecked="{Binding IsAltRequired}" Content="Alt" Foreground="White" Margin="0,0,15,0"/>
<CheckBox IsChecked="{Binding IsShiftRequired}" Content="Shift" Foreground="White" Margin="0,0,15,0"/>
</StackPanel>
<CheckBox IsChecked="{Binding IsWinKeyRequired}" Content="WinKey (Meta)" Foreground="#00BFA5" Margin="0,10,0,0"/>
</StackPanel>
</Border>
</Grid>
</Grid>
</TabItem>
<TabItem Header="SETTINGS">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="0,20,0,0">
<Border Background="#252525" CornerRadius="4" Padding="20" Margin="0,0,0,20">
<StackPanel>
<TextBlock Text="APPLICATION BEHAVIOR" Foreground="#888" FontWeight="Bold" FontSize="12" Margin="0,0,0,15"/>
<CheckBox IsChecked="{Binding RunAtStartup}" Content="Run ZeroInput when Windows starts"
Foreground="White" Margin="0,5" FontSize="14" Cursor="Hand">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Text="Automatically launch minimized to tray on login."
Foreground="#666" FontSize="12" Margin="30,0,0,15"/>
<CheckBox IsChecked="{Binding StartMinimized}" Content="Start minimized to system tray"
Foreground="White" Margin="0,5" FontSize="14" Cursor="Hand">
<CheckBox.LayoutTransform>
<ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
</CheckBox.LayoutTransform>
</CheckBox>
<TextBlock Text="The main window will not appear when the app launches."
Foreground="#666" FontSize="12" Margin="30,0,0,0"/>
</StackPanel>
</Border>
<Border Background="#252525" CornerRadius="4" Padding="20">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,5">
<TextBlock Text="GLOBAL TOGGLE HOTKEY" Foreground="#00BFA5" FontWeight="Bold" FontSize="12"/>
<Border Background="#333" CornerRadius="3" Margin="10,0,0,0" Padding="6,2" VerticalAlignment="Center">
<TextBlock Text="PANIC SWITCH" Foreground="#AAA" FontSize="9" FontWeight="SemiBold"/>
</Border>
</StackPanel>
<TextBlock Grid.Row="1" Text="Pressing this combination anywhere in Windows will toggle protection ON or OFF."
Foreground="#888" FontSize="12" Margin="0,0,0,20" TextWrapping="Wrap"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="0,0,20,0">
<TextBlock Text="Trigger Key" Foreground="White" Margin="0,0,0,8"/>
<ComboBox ItemsSource="{Binding AllKeys}"
SelectedItem="{Binding ToggleKey}"
Height="26" Padding="10,0"
VerticalContentAlignment="Center"
Background="#333" Foreground="Black" BorderThickness="0"/>
</StackPanel>
</Grid>
<StackPanel Grid.Row="3" Margin="0,20,0,0">
<TextBlock Text="Required Modifiers" Foreground="White" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal">
<Border Background="#333" CornerRadius="4" Padding="10,5" Margin="0,0,10,0">
<CheckBox IsChecked="{Binding ToggleCtrl}" Content="Ctrl" Foreground="White" VerticalAlignment="Center"/>
</Border>
<Border Background="#333" CornerRadius="4" Padding="10,5" Margin="0,0,10,0">
<CheckBox IsChecked="{Binding ToggleAlt}" Content="Alt" Foreground="White" VerticalAlignment="Center"/>
</Border>
<Border Background="#333" CornerRadius="4" Padding="10,5" Margin="0,0,10,0">
<CheckBox IsChecked="{Binding ToggleShift}" Content="Shift" Foreground="White" VerticalAlignment="Center"/>
</Border>
<Border Background="#333" CornerRadius="4" Padding="10,5">
<CheckBox IsChecked="{Binding ToggleWin}" Content="Win" Foreground="#00BFA5" VerticalAlignment="Center"/>
</Border>
</StackPanel>
</StackPanel>
</Grid>
</Border>
</StackPanel>
</ScrollViewer>
</TabItem>
</TabControl>
<TextBlock Grid.Row="2" Text="© 2025 Josh 'Kkthnx' Russell. All Rights Reserved." Foreground="#444" FontSize="11" HorizontalAlignment="Center" Margin="0,0,0,-14"/>
</Grid>
</Window>