-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
297 lines (283 loc) · 19.6 KB
/
Copy pathMainWindow.xaml
File metadata and controls
297 lines (283 loc) · 19.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
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
<Window
x:Class="Caelum.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Caelum.Controls"
Title="OpenNotes"
ShowInTaskbar="True"
Height="720" Width="1280"
WindowStartupLocation="CenterScreen"
Background="{DynamicResource ThemeWindowBrush}"
AllowDrop="True"
WindowStyle="None"
ResizeMode="CanResize">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="40" GlassFrameThickness="0" UseAeroCaptionButtons="False" ResizeBorderThickness="6" />
</WindowChrome.WindowChrome>
<Window.Resources>
<Style x:Key="NavButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="28"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Root" Background="{TemplateBinding Background}" CornerRadius="16" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeControlHoverBrush}"/>
<Setter TargetName="Root" Property="CornerRadius" Value="16"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.3"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TitleBarButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Width" Value="46"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeSubtleForegroundBrush}"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Root" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeControlHoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CloseButtonStyle" TargetType="Button" BasedOn="{StaticResource TitleBarButtonStyle}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Root" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="0,8,0,0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Root" Property="Background" Value="#C42B1C"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Root" Property="Background" Value="#B22A1B"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ToolbarTextButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Height" Value="28"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Padding" Value="8,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Root" Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeControlHoverBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SelectToolbarButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeSubtleForegroundBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Height" Value="28"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Padding" Value="10,4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Root" Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Tag" Value="False"/>
<Condition Property="IsMouseOver" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeControlHoverBrush}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Tag" Value="True"/>
<Condition Property="IsMouseOver" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeSelectionBrush}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Tag" Value="False"/>
<Condition Property="IsPressed" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeControlPressedBrush}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Tag" Value="True"/>
<Condition Property="IsPressed" Value="True"/>
</MultiTrigger.Conditions>
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeAccentPressedBrush}"/>
</MultiTrigger>
<Trigger Property="Tag" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource ThemeSelectionBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeSelectionForegroundBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Border x:Name="WindowOutlineBorder"
BorderBrush="{DynamicResource ThemeWindowOutlineBrush}"
BorderThickness="1"
Background="{DynamicResource ThemeDeskBrush}">
<Grid Background="Transparent" AllowDrop="True">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border x:Name="TitleBarBorder" Grid.Row="0" Background="{DynamicResource ThemeToolbarBrush}">
<Grid>
<Border x:Name="BrandMarginRail"
Width="3"
Margin="8,8,0,8"
HorizontalAlignment="Left"
Background="{DynamicResource ThemeMarginBrush}"
CornerRadius="2"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Image Source="{Binding Icon, RelativeSource={RelativeSource AncestorType=Window}}" Width="20" Height="20" Margin="14,0,4,0" RenderOptions.BitmapScalingMode="HighQuality"/>
<TextBlock x:Name="ProductNameTextBlock" Text="OpenNotes" FontSize="13" Foreground="{DynamicResource ThemeForegroundBrush}" Margin="6,0,12,0" VerticalAlignment="Center" FontWeight="SemiBold"/>
<Button x:Name="NavBackButton" Click="NavBack_Click" Style="{StaticResource NavButtonStyle}" IsEnabled="False" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="ArrowLeft" Width="14" Height="14" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
</Button>
<Button x:Name="NavForwardButton" Click="NavForward_Click" Style="{StaticResource NavButtonStyle}" IsEnabled="False" Margin="2,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="ArrowRight" Width="14" Height="14" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
</Button>
<Button x:Name="NavHomeButton" Click="NavHome_Click" Style="{StaticResource NavButtonStyle}" Margin="2,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="Home" Width="15" Height="15" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
</Button>
</StackPanel>
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,140,0">
<Border Background="{DynamicResource ThemePaperBrush}" BorderBrush="{DynamicResource ThemeBorderBrush}" BorderThickness="1" CornerRadius="8" Margin="0,0,8,0" Height="28" VerticalAlignment="Center" WindowChrome.IsHitTestVisibleInChrome="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<controls:LucideIcon Kind="Search" Width="14" Height="14" Stroke="{DynamicResource ThemeSubtleForegroundBrush}" VerticalAlignment="Center" Margin="8,0,4,0"/>
<TextBox x:Name="SearchBox" Grid.Column="1" Style="{StaticResource ModernTextBox}" Background="Transparent" BorderThickness="0" VerticalAlignment="Center" FontSize="12" TextChanged="SearchBox_TextChanged" />
<TextBlock x:Name="SearchPlaceholder" Grid.Column="1" Text="" Foreground="{DynamicResource ThemeSubtleForegroundBrush}" FontSize="12" VerticalAlignment="Center" IsHitTestVisible="False" Margin="2,0,0,0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Text.Length, ElementName=SearchBox}" Value="0">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
<Button x:Name="SelectButton" Click="SelectButton_Click" Style="{StaticResource SelectToolbarButtonStyle}" Margin="0,0,2,0" Tag="False" WindowChrome.IsHitTestVisibleInChrome="True">
<StackPanel Orientation="Horizontal">
<controls:LucideIcon x:Name="SelectButtonIcon" Kind="ListFilter" Width="14" Height="14" Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}" VerticalAlignment="Center"/>
<TextBlock x:Name="SelectButtonLabel" FontSize="12" Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}" Margin="5,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<Button x:Name="SortButton" Click="SortButton_Click" Style="{StaticResource NavButtonStyle}" Margin="0,0,2,0" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="ArrowUpDown" Width="15" Height="15" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
<Button.ContextMenu>
<ContextMenu x:Name="SortContextMenu">
<MenuItem x:Name="SortByNameMenuItem" Click="SortByName_Click"/>
<MenuItem x:Name="SortByDateMenuItem" Click="SortByDate_Click"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
<Button x:Name="MoreButton" Click="MoreButton_Click" Style="{StaticResource NavButtonStyle}" Margin="0,0,8,0"
AutomationProperties.AutomationId="MoreButton" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="Ellipsis" Width="16" Height="16" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
<Button.ContextMenu>
<ContextMenu x:Name="MoreContextMenu">
<MenuItem x:Name="SettingsMenuItem" Click="Settings_Click"/>
<MenuItem x:Name="CheckForUpdatesMenuItem" Click="CheckForUpdates_Click"/>
<MenuItem x:Name="AboutMenuItem" Click="About_Click"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="MinimizeButton" Click="MinimizeButton_Click" Style="{StaticResource TitleBarButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="Minus" Width="13" Height="13" Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}"/>
</Button>
<Button x:Name="MaximizeButton" Click="MaximizeButton_Click" Style="{StaticResource TitleBarButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon x:Name="MaximizeIcon" Kind="Square" Width="12" Height="12" Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}"/>
</Button>
<Button x:Name="CloseButton" Click="CloseButton_Click" PreviewStylusDown="ChromeButton_PreviewStylusDown" Style="{StaticResource CloseButtonStyle}" WindowChrome.IsHitTestVisibleInChrome="True">
<controls:LucideIcon Kind="X" Width="13" Height="13" Stroke="{Binding Foreground, RelativeSource={RelativeSource AncestorType=Button}}"/>
</Button>
</StackPanel>
</Grid>
</Grid>
</Border>
<Border Grid.Row="1" Background="{DynamicResource ThemePaperBrush}" BorderBrush="{DynamicResource ThemeBorderBrush}" BorderThickness="0,0,0,1" Padding="8,4,8,4">
<ScrollViewer Height="32" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled">
<StackPanel Orientation="Horizontal">
<StackPanel x:Name="TabBar" Orientation="Horizontal" AllowDrop="True"/>
<Button x:Name="NewTabButton" Click="NewTab_Click" Style="{StaticResource NavButtonStyle}"
VerticalAlignment="Center"
Width="32" Height="32" Margin="6,0,0,0"
ToolTip="">
<controls:LucideIcon Kind="Plus" Width="16" Height="16" Stroke="{DynamicResource ThemeSubtleForegroundBrush}"/>
</Button>
</StackPanel>
</ScrollViewer>
</Border>
<Grid x:Name="TabContentArea" Grid.Row="2"/>
<Border x:Name="ToastBorder" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Bottom"
Margin="0,0,0,80" Visibility="Collapsed" Opacity="0" IsHitTestVisible="False"
CornerRadius="10" Padding="20,10" Background="{DynamicResource ThemeForegroundBrush}">
<Border.Effect>
<DropShadowEffect BlurRadius="16" ShadowDepth="4" Opacity="{DynamicResource ThemeShadowOpacity}" Color="#000"/>
</Border.Effect>
<StackPanel Orientation="Horizontal">
<controls:LucideIcon x:Name="ToastIcon" Kind="Check" Width="16" Height="16" Stroke="{DynamicResource ThemeAccentBrush}" VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBlock x:Name="ToastText" Text="" FontSize="13" Foreground="{DynamicResource ThemeWindowBackgroundBrush}" VerticalAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</Border>
</Window>