anshdadhich commited on
Commit
fdca789
·
verified ·
1 Parent(s): e37dee7

Upload FastSeekWpf/MainWindow.xaml

Browse files
Files changed (1) hide show
  1. FastSeekWpf/MainWindow.xaml +189 -71
FastSeekWpf/MainWindow.xaml CHANGED
@@ -5,11 +5,11 @@
5
  Title="FastSeek"
6
  Name="FastSeekWnd"
7
  Width="720"
8
- MinHeight="74"
9
- MaxHeight="600"
10
  WindowStyle="None"
11
- AllowsTransparency="False"
12
- Background="#FF0E1018"
13
  ShowInTaskbar="False"
14
  Topmost="True"
15
  ResizeMode="NoResize"
@@ -17,114 +17,232 @@
17
  WindowStartupLocation="Manual"
18
  Loaded="Window_Loaded"
19
  Deactivated="Window_Deactivated"
20
- KeyDown="Window_KeyDown">
 
 
 
21
 
22
  <Window.Resources>
23
- <SolidColorBrush x:Key="AccentBrush" Color="#64A5FF"/>
24
- <SolidColorBrush x:Key="TextBrush" Color="#E6EBFA"/>
25
- <SolidColorBrush x:Key="TextDimBrush" Color="#7882A5"/>
26
- <SolidColorBrush x:Key="HoverBrush" Color="#1A3A6A"/>
27
- <SolidColorBrush x:Key="SelectedBrush" Color="#144A8A"/>
 
 
 
 
 
 
 
28
 
29
  <local:KindToBadgeConverter x:Key="KindToBadge"/>
30
  <local:PathShortenerConverter x:Key="PathShortener"/>
31
  <BooleanToVisibilityConverter x:Key="BoolToVis"/>
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  <Style x:Key="SearchBoxStyle" TargetType="TextBox">
34
  <Setter Property="Background" Value="Transparent"/>
35
  <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
36
  <Setter Property="BorderThickness" Value="0"/>
37
- <Setter Property="FontSize" Value="20"/>
38
- <Setter Property="FontFamily" Value="Segoe UI Variable Display, Segoe UI, sans-serif"/>
39
  <Setter Property="VerticalContentAlignment" Value="Center"/>
40
- <Setter Property="Padding" Value="48,0,16,0"/>
41
  <Setter Property="CaretBrush" Value="{StaticResource AccentBrush}"/>
42
- <Setter Property="SelectionBrush" Value="{StaticResource AccentBrush}"/>
 
43
  </Style>
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  <DataTemplate x:Key="ResultItemTemplate" DataType="local:ResultItem">
46
- <Border Height="56" Background="Transparent" x:Name="RowBorder" Cursor="Hand"
47
- MouseEnter="ResultItem_MouseEnter"
48
  MouseLeftButtonDown="ResultItem_Click">
49
  <Grid>
50
  <Grid.ColumnDefinitions>
51
- <ColumnDefinition Width="52"/>
52
  <ColumnDefinition Width="*"/>
53
  <ColumnDefinition Width="Auto"/>
54
  <ColumnDefinition Width="12"/>
55
  </Grid.ColumnDefinitions>
56
- <TextBlock Grid.Column="0" Text="{Binding IconGlyph}" FontFamily="Segoe MDL2 Assets" FontSize="20"
57
- Foreground="{StaticResource AccentBrush}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
 
 
 
 
 
 
 
58
  <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0">
59
  <TextBlock Text="{Binding DisplayName}" FontSize="14" FontWeight="SemiBold"
60
  Foreground="{StaticResource TextBrush}" TextTrimming="CharacterEllipsis"/>
61
  <TextBlock Text="{Binding FullPath, Converter={StaticResource PathShortener}}"
62
  FontSize="11" Foreground="{StaticResource TextDimBrush}"
63
- TextTrimming="CharacterEllipsis"/>
64
  </StackPanel>
65
- <Border Grid.Column="2" CornerRadius="3.5" Padding="6,1.5" VerticalAlignment="Center" Margin="8,0,0,0"
66
- Background="{Binding Kind, Converter={StaticResource KindToBadge}}">
67
  <TextBlock Text="{Binding BadgeLabel}" FontSize="9" FontWeight="Bold"
68
  Foreground="White"/>
69
  </Border>
70
  </Grid>
71
  </Border>
72
- <DataTemplate.Triggers>
73
- <DataTrigger Binding="{Binding IsSelected}" Value="True">
74
- <Setter TargetName="RowBorder" Property="Background" Value="{StaticResource SelectedBrush}"/>
75
- </DataTrigger>
76
- <DataTrigger Binding="{Binding IsHovered}" Value="True">
77
- <Setter TargetName="RowBorder" Property="Background" Value="{StaticResource HoverBrush}"/>
78
- </DataTrigger>
79
- </DataTemplate.Triggers>
80
  </DataTemplate>
81
  </Window.Resources>
82
 
83
- <Border Background="#FF0E1018" CornerRadius="8" x:Name="WindowBorder" BorderThickness="1"
84
- BorderBrush="#FF2A2D3A" SnapsToDevicePixels="True">
 
 
 
 
 
 
85
  <Border.Effect>
86
- <DropShadowEffect BlurRadius="24" ShadowDepth="4" Direction="270" Opacity="0.4" Color="Black"/>
 
87
  </Border.Effect>
88
 
89
- <Grid>
90
- <Grid.RowDefinitions>
91
- <RowDefinition Height="Auto"/>
92
- <RowDefinition Height="Auto"/>
93
- <RowDefinition Height="*"/>
94
- <RowDefinition Height="Auto"/>
95
- </Grid.RowDefinitions>
96
-
97
- <!-- Search Bar -->
98
- <Grid Grid.Row="0" Height="62">
99
- <Grid.ColumnDefinitions>
100
- <ColumnDefinition Width="Auto"/>
101
- <ColumnDefinition Width="*"/>
102
- </Grid.ColumnDefinitions>
103
- <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="18"
104
- Foreground="{StaticResource AccentBrush}" Margin="20,0,0,0" VerticalAlignment="Center"/>
105
- <TextBox Grid.Column="1" x:Name="SearchBox" Style="{StaticResource SearchBoxStyle}"
106
- TextChanged="SearchBox_TextChanged" Loaded="SearchBox_Loaded"/>
107
- </Grid>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
- <Rectangle Grid.Row="1" Height="1" Fill="White" Opacity="0.05" x:Name="SepLine"
110
- Visibility="Collapsed"/>
111
-
112
- <ScrollViewer Grid.Row="2" x:Name="ResultsScroll" VerticalScrollBarVisibility="Auto"
113
- MaxHeight="420" Visibility="Collapsed">
114
- <ItemsControl x:Name="ResultsList" ItemsSource="{Binding Results, RelativeSource={RelativeSource AncestorType=Window}}"
115
- ItemTemplate="{StaticResource ResultItemTemplate}">
116
- <ItemsControl.ItemsPanel>
117
- <ItemsPanelTemplate>
118
- <VirtualizingStackPanel IsItemsHost="True"/>
119
- </ItemsPanelTemplate>
120
- </ItemsControl.ItemsPanel>
121
- </ItemsControl>
122
- </ScrollViewer>
123
-
124
- <Grid Grid.Row="3" x:Name="StatusBar" Height="28" Background="#FF12141C" Visibility="Collapsed">
125
- <TextBlock x:Name="StatusText" FontSize="10.5" Foreground="{StaticResource TextDimBrush}"
126
- VerticalAlignment="Center" Margin="20,0,0,0"/>
127
  </Grid>
128
- </Grid>
129
  </Border>
130
  </Window>
 
5
  Title="FastSeek"
6
  Name="FastSeekWnd"
7
  Width="720"
8
+ MinHeight="80"
9
+ MaxHeight="560"
10
  WindowStyle="None"
11
+ AllowsTransparency="True"
12
+ Background="Transparent"
13
  ShowInTaskbar="False"
14
  Topmost="True"
15
  ResizeMode="NoResize"
 
17
  WindowStartupLocation="Manual"
18
  Loaded="Window_Loaded"
19
  Deactivated="Window_Deactivated"
20
+ KeyDown="Window_KeyDown"
21
+ SnapsToDevicePixels="False"
22
+ UseLayoutRounding="True"
23
+ RenderOptions.BitmapScalingMode="HighQuality">
24
 
25
  <Window.Resources>
26
+ <!-- Brushes -->
27
+ <SolidColorBrush x:Key="BgBrush" Color="#0E1018" Opacity="0.96"/>
28
+ <SolidColorBrush x:Key="BgSolid" Color="#0E1018"/>
29
+ <SolidColorBrush x:Key="AccentBrush" Color="#5B8DEF"/>
30
+ <SolidColorBrush x:Key="AccentGlow" Color="#5B8DEF" Opacity="0.25"/>
31
+ <SolidColorBrush x:Key="TextBrush" Color="#E8ECF4"/>
32
+ <SolidColorBrush x:Key="TextDimBrush" Color="#6B7280"/>
33
+ <SolidColorBrush x:Key="BorderBrush" Color="#1E2230"/>
34
+ <SolidColorBrush x:Key="HoverBrush" Color="#1A2035"/>
35
+ <SolidColorBrush x:Key="SelectedBrush" Color="#162238"/>
36
+ <SolidColorBrush x:Key="SearchBg" Color="#161B2A"/>
37
+ <SolidColorBrush x:Key="SearchBorder" Color="#252B3D"/>
38
 
39
  <local:KindToBadgeConverter x:Key="KindToBadge"/>
40
  <local:PathShortenerConverter x:Key="PathShortener"/>
41
  <BooleanToVisibilityConverter x:Key="BoolToVis"/>
42
 
43
+ <!-- Window appear animation -->
44
+ <Storyboard x:Key="AppearAnim">
45
+ <DoubleAnimation Storyboard.TargetProperty="Opacity"
46
+ From="0" To="1" Duration="0:0:0.15">
47
+ <DoubleAnimation.EasingFunction>
48
+ <QuadraticEase EasingMode="EaseOut"/>
49
+ </DoubleAnimation.EasingFunction>
50
+ </DoubleAnimation>
51
+ <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
52
+ From="0.96" To="1" Duration="0:0:0.18">
53
+ <DoubleAnimation.EasingFunction>
54
+ <QuadraticEase EasingMode="EaseOut"/>
55
+ </DoubleAnimation.EasingFunction>
56
+ </DoubleAnimation>
57
+ <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
58
+ From="0.96" To="1" Duration="0:0:0.18">
59
+ <DoubleAnimation.EasingFunction>
60
+ <QuadraticEase EasingMode="EaseOut"/>
61
+ </DoubleAnimation.EasingFunction>
62
+ </DoubleAnimation>
63
+ </Storyboard>
64
+
65
+ <Storyboard x:Key="FadeAnim">
66
+ <DoubleAnimation Storyboard.TargetProperty="Opacity"
67
+ To="0" Duration="0:0:0.1"/>
68
+ </Storyboard>
69
+
70
+ <!-- Search box style -->
71
  <Style x:Key="SearchBoxStyle" TargetType="TextBox">
72
  <Setter Property="Background" Value="Transparent"/>
73
  <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
74
  <Setter Property="BorderThickness" Value="0"/>
75
+ <Setter Property="FontSize" Value="19"/>
76
+ <Setter Property="FontFamily" Value="Segoe UI Variable Text, Segoe UI, sans-serif"/>
77
  <Setter Property="VerticalContentAlignment" Value="Center"/>
78
+ <Setter Property="Padding" Value="44,0,16,0"/>
79
  <Setter Property="CaretBrush" Value="{StaticResource AccentBrush}"/>
80
+ <Setter Property="SelectionBrush" Value="#3A5A8A"/>
81
+ <Setter Property="SelectionOpacity" Value="0.6"/>
82
  </Style>
83
 
84
+ <!-- Result item container style -->
85
+ <Style x:Key="ResultContainerStyle" TargetType="ListBoxItem">
86
+ <Setter Property="Padding" Value="0"/>
87
+ <Setter Property="Margin" Value="8,1,8,1"/>
88
+ <Setter Property="BorderThickness" Value="0"/>
89
+ <Setter Property="Background" Value="Transparent"/>
90
+ <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
91
+ <Setter Property="Template">
92
+ <Setter.Value>
93
+ <ControlTemplate TargetType="ListBoxItem">
94
+ <Border x:Name="Bd"
95
+ Background="{TemplateBinding Background}"
96
+ CornerRadius="8"
97
+ SnapsToDevicePixels="False">
98
+ <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
99
+ VerticalAlignment="Center"/>
100
+ </Border>
101
+ <ControlTemplate.Triggers>
102
+ <Trigger Property="IsSelected" Value="True">
103
+ <Setter TargetName="Bd" Property="Background" Value="{StaticResource SelectedBrush}"/>
104
+ </Trigger>
105
+ <Trigger Property="IsMouseOver" Value="True">
106
+ <Setter TargetName="Bd" Property="Background" Value="{StaticResource HoverBrush}"/>
107
+ </Trigger>
108
+ </ControlTemplate.Triggers>
109
+ </ControlTemplate>
110
+ </Setter.Value>
111
+ </Setter>
112
+ </Style>
113
+
114
+ <!-- Result item data template -->
115
  <DataTemplate x:Key="ResultItemTemplate" DataType="local:ResultItem">
116
+ <Border Height="52" Background="Transparent" Cursor="Hand"
 
117
  MouseLeftButtonDown="ResultItem_Click">
118
  <Grid>
119
  <Grid.ColumnDefinitions>
120
+ <ColumnDefinition Width="48"/>
121
  <ColumnDefinition Width="*"/>
122
  <ColumnDefinition Width="Auto"/>
123
  <ColumnDefinition Width="12"/>
124
  </Grid.ColumnDefinitions>
125
+ <!-- Icon background circle -->
126
+ <Border Grid.Column="0" Width="32" Height="32" CornerRadius="8"
127
+ Background="{Binding Kind, Converter={StaticResource KindToBadge}}"
128
+ HorizontalAlignment="Center" VerticalAlignment="Center"
129
+ Opacity="0.15">
130
+ </Border>
131
+ <TextBlock Grid.Column="0" Text="{Binding IconGlyph}" FontFamily="Segoe MDL2 Assets" FontSize="16"
132
+ Foreground="{Binding Kind, Converter={StaticResource KindToBadge}}"
133
+ HorizontalAlignment="Center" VerticalAlignment="Center"/>
134
  <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0">
135
  <TextBlock Text="{Binding DisplayName}" FontSize="14" FontWeight="SemiBold"
136
  Foreground="{StaticResource TextBrush}" TextTrimming="CharacterEllipsis"/>
137
  <TextBlock Text="{Binding FullPath, Converter={StaticResource PathShortener}}"
138
  FontSize="11" Foreground="{StaticResource TextDimBrush}"
139
+ TextTrimming="CharacterEllipsis" Margin="0,2,0,0"/>
140
  </StackPanel>
141
+ <Border Grid.Column="2" CornerRadius="4" Padding="6,2" VerticalAlignment="Center" Margin="8,0,0,0"
142
+ Background="{Binding Kind, Converter={StaticResource KindToBadge}}" Opacity="0.85">
143
  <TextBlock Text="{Binding BadgeLabel}" FontSize="9" FontWeight="Bold"
144
  Foreground="White"/>
145
  </Border>
146
  </Grid>
147
  </Border>
 
 
 
 
 
 
 
 
148
  </DataTemplate>
149
  </Window.Resources>
150
 
151
+ <Window.RenderTransform>
152
+ <ScaleTransform ScaleX="1" ScaleY="1" CenterX="360" CenterY="0"/>
153
+ </Window.RenderTransform>
154
+
155
+ <!-- Outer glow border -->
156
+ <Border Background="Transparent" CornerRadius="14" Margin="12"
157
+ BorderThickness="1" BorderBrush="{StaticResource BorderBrush}"
158
+ SnapsToDevicePixels="False">
159
  <Border.Effect>
160
+ <DropShadowEffect BlurRadius="32" ShadowDepth="0" Direction="0" Opacity="0.35" Color="Black"
161
+ RenderingBias="Quality"/>
162
  </Border.Effect>
163
 
164
+ <!-- Main content with rounded background -->
165
+ <Border Background="{StaticResource BgSolid}" CornerRadius="12"
166
+ BorderThickness="1" BorderBrush="#1A1E2E">
167
+
168
+ <Grid>
169
+ <Grid.RowDefinitions>
170
+ <RowDefinition Height="Auto"/>
171
+ <RowDefinition Height="Auto"/>
172
+ <RowDefinition Height="*"/>
173
+ <RowDefinition Height="Auto"/>
174
+ </Grid.RowDefinitions>
175
+
176
+ <!-- Search Bar -->
177
+ <Border Grid.Row="0" Margin="16,16,16,8" CornerRadius="10"
178
+ Background="{StaticResource SearchBg}"
179
+ BorderThickness="1" BorderBrush="{StaticResource SearchBorder}">
180
+ <Grid Height="46">
181
+ <Grid.ColumnDefinitions>
182
+ <ColumnDefinition Width="Auto"/>
183
+ <ColumnDefinition Width="*"/>
184
+ </Grid.ColumnDefinitions>
185
+ <TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="16"
186
+ Foreground="{StaticResource TextDimBrush}" Margin="16,0,0,0"
187
+ VerticalAlignment="Center"/>
188
+ <TextBox Grid.Column="1" x:Name="SearchBox" Style="{StaticResource SearchBoxStyle}"
189
+ TextChanged="SearchBox_TextChanged" Loaded="SearchBox_Loaded"
190
+ VerticalAlignment="Center"/>
191
+ </Grid>
192
+ </Border>
193
+
194
+ <!-- Separator -->
195
+ <Rectangle Grid.Row="1" Height="1" Fill="White" Opacity="0.04" x:Name="SepLine"
196
+ Margin="16,0,16,0" Visibility="Collapsed"/>
197
+
198
+ <!-- Results -->
199
+ <Border Grid.Row="2" Margin="8,4,8,4" CornerRadius="8" Background="Transparent"
200
+ Visibility="{Binding Results.Count, RelativeSource={RelativeSource AncestorType=Window}, Converter={StaticResource BoolToVis}}">
201
+ <ScrollViewer x:Name="ResultsScroll" VerticalScrollBarVisibility="Auto"
202
+ MaxHeight="380" Style="{x:Null}">
203
+ <ListBox x:Name="ResultsList"
204
+ ItemsSource="{Binding Results, RelativeSource={RelativeSource AncestorType=Window}}"
205
+ ItemTemplate="{StaticResource ResultItemTemplate}"
206
+ ItemContainerStyle="{StaticResource ResultContainerStyle}"
207
+ Background="Transparent"
208
+ BorderThickness="0"
209
+ Focusable="False"
210
+ SelectionChanged="ResultsList_SelectionChanged"
211
+ VirtualizingStackPanel.IsVirtualizing="True"
212
+ VirtualizingStackPanel.VirtualizationMode="Recycling"
213
+ ScrollViewer.CanContentScroll="True">
214
+ <ListBox.ItemsPanel>
215
+ <ItemsPanelTemplate>
216
+ <VirtualizingStackPanel IsItemsHost="True"/>
217
+ </ItemsPanelTemplate>
218
+ </ListBox.ItemsPanel>
219
+ </ListBox>
220
+ </ScrollViewer>
221
+ </Border>
222
+
223
+ <!-- Empty state hint -->
224
+ <TextBlock Grid.Row="2" x:Name="EmptyHint"
225
+ Text="Start typing to search your files..."
226
+ Foreground="{StaticResource TextDimBrush}"
227
+ FontSize="13"
228
+ HorizontalAlignment="Center"
229
+ VerticalAlignment="Center"
230
+ Margin="0,20,0,20"
231
+ Visibility="Collapsed"/>
232
 
233
+ <!-- Status Bar -->
234
+ <Border Grid.Row="3" x:Name="StatusBar" Height="32"
235
+ Background="Transparent" Visibility="Collapsed"
236
+ Margin="16,0,16,8">
237
+ <Grid>
238
+ <TextBlock x:Name="StatusText" FontSize="11" Foreground="{StaticResource TextDimBrush}"
239
+ VerticalAlignment="Center"/>
240
+ <TextBlock x:Name="HotkeyHint" FontSize="11" Foreground="{StaticResource TextDimBrush}"
241
+ VerticalAlignment="Center" HorizontalAlignment="Right"
242
+ Text="Ctrl+Shift+Space to toggle"/>
243
+ </Grid>
244
+ </Border>
 
 
 
 
 
 
245
  </Grid>
246
+ </Border>
247
  </Border>
248
  </Window>