-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
213 lines (192 loc) · 11.6 KB
/
MainWindow.xaml
File metadata and controls
213 lines (192 loc) · 11.6 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
<Window x:Class="NetIsolatePlus.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="NetIsolate+"
WindowStartupLocation="Manual"
ResizeMode="NoResize"
WindowStyle="None"
Background="Transparent"
AllowsTransparency="True"
SizeToContent="WidthAndHeight">
<Border x:Name="RootChrome"
Background="#0D0D0D"
BorderBrush="#2A2A2A"
BorderThickness="1"
CornerRadius="14"
SnapsToDevicePixels="True"
ClipToBounds="True">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="44"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!-- Title bar -->
<Border Grid.Row="0"
CornerRadius="13,13,0,0"
Background="#111111">
<Grid x:Name="TitleBarGrid"
Background="Transparent"
MouseLeftButtonDown="TitleBar_MouseLeftButtonDown">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="32"/> <!-- minimize -->
<ColumnDefinition Width="32"/> <!-- about -->
<ColumnDefinition Width="32"/> <!-- close -->
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="12,0">
<Image x:Name="TitleIcon"
Source="pack://application:,,,/Assets/NetIsolatePlus.ico"
Width="30" Height="30" Margin="0,0,8,0"/>
<TextBlock Text="NetIsolate+" Foreground="#F0F0F0" FontWeight="Bold" FontSize="20"/>
</StackPanel>
<Button Grid.Column="1" Click="Minimize_Click" ToolTip="Minimize"
Background="Transparent" BorderBrush="{x:Null}" Padding="0" Cursor="Hand">
<TextBlock Text="—" Foreground="#F0F0F0" FontWeight="Bold" FontSize="16"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Grid.Column="2" Click="About_Click" ToolTip="About"
Background="Transparent" BorderBrush="{x:Null}" Padding="0" Cursor="Hand">
<TextBlock Text="?" Foreground="#F0F0F0" FontWeight="Bold" FontSize="16"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Grid.Column="3" Click="Close_Click" ToolTip="Close"
Background="Transparent" BorderBrush="{x:Null}" Padding="0" Cursor="Hand">
<!-- Close button ONLY: rounded hover in the top-right corner -->
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd" Background="Transparent" CornerRadius="0,13,0,0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E81123"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#C50F1F"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
<TextBlock Text="×" Foreground="#F0F0F0" FontWeight="Bold" FontSize="18"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</Grid>
</Border>
<!-- Controls bar -->
<Grid x:Name="ControlBar" Grid.Row="1" Background="#121212" Height="36">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="12,0,0,0">
<!-- Virtual Adapters -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Virtual adapters " Foreground="#A9A9A9" VerticalAlignment="Center" FontSize="12"/>
<CheckBox x:Name="ToggleVirtual" Style="{StaticResource ToggleSwitchStyle}"
Checked="ToggleVirtual_Checked" Unchecked="ToggleVirtual_Checked"/>
</StackPanel>
<!-- Startup -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<TextBlock Text=" Start with Windows " Foreground="#A9A9A9" VerticalAlignment="Center" FontSize="12"/>
<CheckBox x:Name="ToggleStartup" Style="{StaticResource ToggleSwitchStyle}"
Checked="ToggleStartup_Checked" Unchecked="ToggleStartup_Checked"/>
</StackPanel>
<!-- Sort -->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text=" Sort by: " Foreground="#A9A9A9" VerticalAlignment="Center" FontSize="12"/>
<ComboBox x:Name="SortCombo"
Style="{StaticResource DarkComboBox}"
Width="160"
Background="#141414"
Foreground="White"
BorderBrush="#2A2A2A"
Margin="0,0,10,0"
SelectionChanged="SortCombo_SelectionChanged">
<ComboBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#141414"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="#FFFFFF"/>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#1F2A30"/>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="#FFFFFF"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="#2A2A2A"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkBrushKey}" Color="#2A2A2A"/>
</ComboBox.Resources>
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#141414"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Bd" Background="{TemplateBinding Background}">
<ContentPresenter Margin="{TemplateBinding Padding}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#1E1E1E"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#232323"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBoxItem Content="Enabled first" Tag="Enabled"/>
<ComboBoxItem Content="Disabled first" Tag="Disabled"/>
<ComboBoxItem Content="Name (A→Z)" Tag="Name"/>
<ComboBoxItem Content="Name (Z→A)" Tag="NameDesc"/>
</ComboBox>
</StackPanel>
</StackPanel>
<!-- Bulk toggle on the right (minimal layout impact) -->
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,10,0">
<TextBlock Text="Toggle All:" Foreground="#A9A9A9" VerticalAlignment="Center" FontSize="12" Margin="0,0,6,0"/>
<CheckBox x:Name="BulkToggle" Style="{StaticResource ToggleSwitchStyle}"
Checked="BulkToggle_Checked" Unchecked="BulkToggle_Checked"/>
</StackPanel>
</Grid>
<!-- Content -->
<ScrollViewer x:Name="Scroller" Grid.Row="2"
Margin="10,10,10,10"
Padding="0"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<StackPanel x:Name="ListHost"/>
</ScrollViewer>
<!-- Busy overlay -->
<Grid x:Name="BusyOverlay"
Grid.RowSpan="3"
Visibility="Collapsed"
Background="#70000000"
IsHitTestVisible="False"
Panel.ZIndex="999">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid Width="56" Height="56" Margin="0,0,0,8" SnapsToDevicePixels="True">
<Ellipse Stroke="#33FFFFFF" StrokeThickness="5"/>
<Path
Stroke="{StaticResource AccentBrush}"
StrokeThickness="5"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
StrokeDashArray="0.25 1.75"
StrokeDashCap="Round"
Data="M28,6 A22,22 0 1 1 27.99,6">
<Path.Effect>
<DropShadowEffect Color="#4CC2FF" BlurRadius="8" ShadowDepth="0" Opacity="0.7"/>
</Path.Effect>
<Path.RenderTransform>
<RotateTransform x:Name="SpinnerRotate" Angle="0" CenterX="28" CenterY="28"/>
</Path.RenderTransform>
</Path>
</Grid>
<TextBlock Text="Working..." Foreground="{StaticResource TextBrush}" FontSize="13"
HorizontalAlignment="Center"/>
</StackPanel>
</Grid>
</Grid>
</Border>
</Window>