Skip to content

Commit 64f3ca6

Browse files
committed
(#1281) Small enhancements in settings UI
1 parent 5254399 commit 64f3ca6

File tree

1 file changed

+40
-54
lines changed

1 file changed

+40
-54
lines changed

src/UI/Lanceur.Ui.WPF/Views/Pages/ApplicationSettingsView.xaml

Lines changed: 40 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@
1818
<Thickness x:Key="RegionMargin">10,5,5,10</Thickness>
1919
<ui:FontTypography x:Key="RegionFontTypography">BodyStrong</ui:FontTypography>
2020

21+
<Style BasedOn="{StaticResource {x:Type ui:CardControl}}" TargetType="{x:Type ui:CardControl}">
22+
<Setter Property="Margin" Value="5,5,15,0" />
23+
</Style>
24+
<Style BasedOn="{StaticResource {x:Type ui:TextBox}}" TargetType="{x:Type ui:TextBox}">
25+
<Setter Property="Padding" Value="8,4" />
26+
</Style>
27+
<Style BasedOn="{StaticResource {x:Type ComboBox}}" TargetType="{x:Type ComboBox}">
28+
<Setter Property="Padding" Value="8,4" />
29+
</Style>
30+
<Style BasedOn="{StaticResource {x:Type ui:PasswordBox}}" TargetType="{x:Type ui:PasswordBox}">
31+
<Setter Property="Padding" Value="8,4" />
32+
</Style>
33+
2134
<!-- Data providers -->
2235
<ObjectDataProvider
2336
x:Key="KeySource"
@@ -55,10 +68,7 @@
5568
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
5669
Text="Window" />
5770

58-
<ui:CardControl
59-
Margin="5,5,5,12"
60-
Icon="{ui:SymbolIcon Keyboard24}"
61-
ToolTipService.ToolTip="Defines the keyboard shortcut used to open the search interface and start searching aliases. Choose a key combination that does not conflict with system or application shortcuts.">
71+
<ui:CardControl Icon="{ui:SymbolIcon Keyboard24}" ToolTipService.ToolTip="Defines the keyboard shortcut used to open the search interface and start searching aliases. Choose a key combination that does not conflict with system or application shortcuts.">
6272
<ui:CardControl.Header>
6373
<ui:TextBlock FontTypography="Body" Text="Hot key" />
6474
</ui:CardControl.Header>
@@ -83,7 +93,7 @@
8393
</StackPanel>
8494
</ui:CardControl>
8595

86-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Color24}">
96+
<ui:CardControl Icon="{ui:SymbolIcon Color24}">
8797
<ui:CardControl.ToolTip>
8898
<ToolTip
8999
MaxWidth="360"
@@ -125,7 +135,7 @@
125135

126136
</ui:CardControl>
127137

128-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Glasses24}">
138+
<ui:CardControl Icon="{ui:SymbolIcon Glasses24}">
129139
<ui:CardControl.Header>
130140
<ui:TextBlock FontTypography="Body" Text="Show search after Windows loads and Lanceur starts?" />
131141
</ui:CardControl.Header>
@@ -137,7 +147,7 @@
137147
</StackPanel>
138148
</ui:CardControl>
139149

140-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon ReadingList24}">
150+
<ui:CardControl Icon="{ui:SymbolIcon ReadingList24}">
141151
<ui:CardControl.Header>
142152
<ui:TextBlock FontTypography="Body" Text="Notification Duration (in seconds)." />
143153
</ui:CardControl.Header>
@@ -151,15 +161,15 @@
151161
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
152162
Text="Search box" />
153163

154-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Timer24}">
164+
<ui:CardControl Icon="{ui:SymbolIcon Timer24}">
155165
<ui:CardControl.Header>
156166
<ui:TextBlock FontTypography="Body" Text="Search Trigger Delay (ms)" />
157167
</ui:CardControl.Header>
158168
<ui:CardControl.ToolTip>Time in milliseconds before search starts after typing stops.</ui:CardControl.ToolTip>
159169
<ui:NumberBox Value="{Binding SearchDelay, UpdateSourceTrigger=PropertyChanged}" />
160170
</ui:CardControl>
161171

162-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon ClipboardBulletListLtr20}">
172+
<ui:CardControl Icon="{ui:SymbolIcon ClipboardBulletListLtr20}">
163173
<ui:CardControl.Header>
164174
<ui:TextBlock FontTypography="Body" Text="When search box becomes visible..." />
165175
</ui:CardControl.Header>
@@ -170,7 +180,7 @@
170180
OnContent="Show all results" />
171181
</StackPanel>
172182
</ui:CardControl>
173-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon SlideHide24}">
183+
<ui:CardControl Icon="{ui:SymbolIcon SlideHide24}">
174184
<ui:CardControl.Header>
175185
<ui:TextBlock FontTypography="Body" Text="Shortcut shows search; repeat hides" />
176186
</ui:CardControl.Header>
@@ -183,7 +193,7 @@
183193
</StackPanel>
184194
</ui:CardControl>
185195

186-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Search24}">
196+
<ui:CardControl Icon="{ui:SymbolIcon Search24}">
187197
<ui:CardControl.Header>
188198
<ui:TextBlock FontTypography="Body" Text="Should the last query be shown when the search opens?" />
189199
</ui:CardControl.Header>
@@ -195,10 +205,7 @@
195205
</StackPanel>
196206
</ui:CardControl>
197207

198-
<ui:CardControl
199-
Margin="5,5,5,12"
200-
Icon="{ui:SymbolIcon Settings24}"
201-
ToolTip="Controls whether the settings button is visible in the search box.">
208+
<ui:CardControl Icon="{ui:SymbolIcon Settings24}" ToolTip="Controls whether the settings button is visible in the search box.">
202209
<ui:CardControl.Header>
203210
<ui:TextBlock FontTypography="Body" Text="Show settings button in search box?" />
204211
</ui:CardControl.Header>
@@ -210,10 +217,7 @@
210217
</StackPanel>
211218
</ui:CardControl>
212219

213-
<ui:CardControl
214-
Margin="5,5,5,12"
215-
Icon="{ui:SymbolIcon Pin24}"
216-
ToolTip="Keep the status bar visible at all times, even when there are no active results to display.">
220+
<ui:CardControl Icon="{ui:SymbolIcon Pin24}" ToolTip="Keep the status bar visible at all times, even when there are no active results to display.">
217221
<ui:CardControl.Header>
218222
<ui:TextBlock FontTypography="Body" Text="Always show status bar" />
219223
</ui:CardControl.Header>
@@ -225,40 +229,32 @@
225229
</StackPanel>
226230
</ui:CardControl>
227231

232+
<!-- DATA SOURCE -->
228233
<ui:TextBlock
229234
Margin="{StaticResource RegionMargin}"
230235
FontTypography="{StaticResource RegionFontTypography}"
231236
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
232237
Text="Data sources" />
233238

234-
<ui:CardControl
235-
Margin="5,0,5,12"
236-
Icon="{ui:SymbolIcon Database24}"
237-
ToolTip="This change will take effect until you restart the application or adjust it again here.">
239+
<ui:CardControl Icon="{ui:SymbolIcon Database24}" ToolTip="This change will take effect until you restart the application or adjust it again here.">
238240
<ui:CardControl.Header>
239241
<ui:TextBlock FontTypography="Body" Text="Database" />
240242
</ui:CardControl.Header>
241243
<StackPanel Orientation="Horizontal">
242-
<ui:TextBox
243-
MinWidth="500"
244-
Margin="5"
245-
Text="{Binding DbPath}" />
244+
<ui:TextBox MinWidth="500" Text="{Binding DbPath}" />
246245
<ui:Button
247246
Margin="5,0,0,0"
248247
Click="OnClickDbPath"
249248
Content="Select database" />
250249
</StackPanel>
251250
</ui:CardControl>
252251

253-
<ui:CardControl
254-
Margin="5,0,5,12"
255-
Icon="{ui:SymbolIcon BookmarkSearch24}"
256-
ToolTip="Select the main browser to use for searching your bookmarks.">
252+
<ui:CardControl Icon="{ui:SymbolIcon BookmarkSearch24}" ToolTip="Select the main browser to use for searching your bookmarks.">
257253

258254
<ui:CardControl.Header>
259255
<ui:TextBlock FontTypography="Body" Text="Source of the bookmarks" />
260256
</ui:CardControl.Header>
261-
<StackPanel>
257+
<StackPanel Orientation="Horizontal">
262258
<ComboBox ItemsSource="{StaticResource Browsers}" SelectedItem="{Binding BookmarkSourceBrowser}" />
263259
</StackPanel>
264260
</ui:CardControl>
@@ -268,10 +264,7 @@
268264
FontTypography="{StaticResource RegionFontTypography}"
269265
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
270266
Text="Stores" />
271-
<ui:CardExpander
272-
Margin="5,5,5,12"
273-
Icon="{ui:SymbolIcon DatabaseSearch24}"
274-
IsExpanded="True">
267+
<ui:CardExpander Icon="{ui:SymbolIcon DatabaseSearch24}" IsExpanded="True">
275268
<ui:CardExpander.Header>
276269
<ui:TextBlock
277270
Grid.Row="0"
@@ -280,7 +273,7 @@
280273
Text="Everything Store Configuration" />
281274
</ui:CardExpander.Header>
282275
<StackPanel>
283-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon SlideHide24}">
276+
<ui:CardControl Icon="{ui:SymbolIcon SlideHide24}">
284277
<ui:CardControl.Header>
285278
<ui:TextBlock FontTypography="Body" Text="Should hidden files be excluded from the results?" />
286279
</ui:CardControl.Header>
@@ -292,7 +285,7 @@
292285
</StackPanel>
293286
</ui:CardControl>
294287

295-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon ShieldKeyhole24}">
288+
<ui:CardControl Icon="{ui:SymbolIcon ShieldKeyhole24}">
296289
<ui:CardControl.Header>
297290
<ui:TextBlock FontTypography="Body" Text="Should system files be excluded from the results?" />
298291
</ui:CardControl.Header>
@@ -304,7 +297,7 @@
304297
</StackPanel>
305298
</ui:CardControl>
306299

307-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Run24}">
300+
<ui:CardControl Icon="{ui:SymbolIcon Run24}">
308301
<ui:CardControl.Header>
309302
<ui:TextBlock FontTypography="Body" Text="Should only executable files be included in the results?" />
310303
</ui:CardControl.Header>
@@ -316,7 +309,7 @@
316309
</StackPanel>
317310
</ui:CardControl>
318311

319-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Delete24}">
312+
<ui:CardControl Icon="{ui:SymbolIcon Delete24}">
320313
<ui:CardControl.Header>
321314
<ui:TextBlock FontTypography="Body" Text="Should files in the Recycle Bin be excluded from the results?" />
322315
</ui:CardControl.Header>
@@ -330,10 +323,7 @@
330323
</StackPanel>
331324
</ui:CardExpander>
332325

333-
<ui:CardExpander
334-
Margin="5,5,5,12"
335-
Icon="{ui:SymbolIcon ArrowUpRight24}"
336-
IsExpanded="True">
326+
<ui:CardExpander Icon="{ui:SymbolIcon ArrowUpRight24}" IsExpanded="True">
337327
<ui:CardExpander.Header>
338328
<Grid>
339329
<Grid.RowDefinitions>
@@ -411,10 +401,7 @@
411401
Text="Feature flags" />
412402

413403
<!-- Feature flags -->
414-
<ui:CardExpander
415-
Margin="5,5,5,12"
416-
Icon="{ui:SymbolIcon FlagCheckered20}"
417-
IsExpanded="True">
404+
<ui:CardExpander Icon="{ui:SymbolIcon FlagCheckered20}" IsExpanded="True">
418405
<ui:CardExpander.Header>
419406
<ui:TextBlock
420407
Grid.Row="0"
@@ -425,7 +412,7 @@
425412
<ItemsControl ItemsSource="{Binding FeatureFlags}">
426413
<ItemsControl.ItemTemplate>
427414
<DataTemplate>
428-
<ui:CardControl Margin="5,5,5,12">
415+
<ui:CardControl>
429416
<ui:CardControl.Icon>
430417
<ui:SymbolIcon Symbol="{Binding Icon}" />
431418
</ui:CardControl.Icon>
@@ -454,7 +441,7 @@
454441
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
455442
Text="Miscellaneous" />
456443

457-
<ui:CardControl Margin="5,0,5,12" Icon="{ui:SymbolIcon NoteBookError24}">
444+
<ui:CardControl Icon="{ui:SymbolIcon NoteBookError24}">
458445
<ui:CardControl.Header>
459446
<ui:TextBlock FontTypography="Body" Text="Minimum Log Detail" />
460447
</ui:CardControl.Header>
@@ -466,7 +453,7 @@
466453
</StackPanel>
467454
</ui:CardControl>
468455

469-
<ui:CardControl Margin="5,0,5,12" Icon="{ui:SymbolIcon PersonKey20}">
456+
<ui:CardControl Icon="{ui:SymbolIcon PersonKey20}">
470457
<ui:CardControl.Header>
471458
<ui:TextBlock FontTypography="Body" Text="GitHub API Token" />
472459
</ui:CardControl.Header>
@@ -478,7 +465,6 @@
478465

479466
<!-- Resource monitor settings -->
480467
<ui:CardExpander
481-
Margin="5,5,5,12"
482468
Icon="{ui:SymbolIcon Gauge24}"
483469
IsExpanded="True"
484470
Visibility="{Binding IsResourceMonitorEnabled, Converter={StaticResource BooleanToVisibilityConverter}, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}">
@@ -491,7 +477,7 @@
491477
</ui:CardExpander.Header>
492478

493479
<StackPanel>
494-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon Timer24}">
480+
<ui:CardControl Icon="{ui:SymbolIcon Timer24}">
495481
<ui:CardControl.Header>
496482
<ui:TextBlock FontTypography="Body" Text="Refresh rate (ms)" />
497483
</ui:CardControl.Header>
@@ -504,7 +490,7 @@
504490
Value="{Binding RefreshRate, UpdateSourceTrigger=PropertyChanged}" />
505491
</ui:CardControl>
506492

507-
<ui:CardControl Margin="5,5,5,12" Icon="{ui:SymbolIcon BezierCurveSquare20}">
493+
<ui:CardControl Icon="{ui:SymbolIcon BezierCurveSquare20}">
508494
<ui:CardControl.Header>
509495
<ui:TextBlock FontTypography="Body" Text="CPU smoothing index" />
510496
</ui:CardControl.Header>

0 commit comments

Comments
 (0)