Frequency navigation

This commit is contained in:
2023-02-27 23:19:04 +01:00
parent 650b650cd8
commit 05c1f026e6
10 changed files with 130 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
{
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Default": "Verbose",
"Override": {
"Microsoft": "Information",
"System": "Warning"

View File

@@ -18,6 +18,8 @@ public class ToastMessageSink : ILogEventSink
if (logEvent.Level >= LogEventLevel.Error)
{
var message = logEvent.RenderMessage();
if (logEvent.Exception is not null)
message += $" {logEvent.Exception.Message}";
dialogService.ShowToastMessage(message);
}
}

View File

@@ -40,6 +40,21 @@
</Setter>
</Style>
<Style Selector="ListBox.CommandPalette">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<Style Selector="ListBox.CommandPalette &gt; ListBoxItem">
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
<Style Selector="ListBox.CommandPalette &gt; ListBoxItem[IsSelected=true] TextBlock">
<Setter Property="Foreground" Value="{DynamicResource SelectedItemForegroundBrush}" />
</Style>
<Style Selector="Grid.SidebarContainerPresenter">
<Setter Property="Background" Value="#01000000" />
</Style>

View File

@@ -9,21 +9,28 @@
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="viewModels:IFrequencyNavigationViewModel"
Background="{DynamicResource ContainerBackgroundColor}"
mc:Ignorable="d">
<UserControl.Styles>
<StyleInclude Source="avares://FileTime.GuiApp/Resources/Styles.axaml" />
</UserControl.Styles>
<Grid RowDefinitions="Auto,*">
<TextBox
Focusable="True"
KeyDown="Search_OnKeyDown"
Text="{Binding SearchText, Mode=TwoWay}" />
<ItemsRepeater
<ListBox
Grid.Row="1"
Items="{Binding FilteredMatches}">
<ItemsRepeater.ItemTemplate>
Classes="CommandPalette"
Items="{Binding FilteredMatches}"
SelectedItem="{Binding SelectedItem}">
<ListBox.ItemTemplate>
<DataTemplate x:DataType="x:String">
<Grid Margin="5">
<TextBlock Text="{Binding}" />
</Grid>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

View File

@@ -26,5 +26,9 @@ public partial class FrequencyNavigation : UserControl
{
viewModel.Close();
}
else
{
viewModel.HandleKeyDown(e);
}
}
}

View File

@@ -719,12 +719,13 @@
<Border
DataContext="{Binding FrequencyNavigationService.CurrentModal}"
Margin="100"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource BarelyTransparentBackgroundColor}"
IsVisible="{Binding ShowWindow^, FallbackValue=False}">
<local:FrequencyNavigation />
<Grid Margin="100">
<local:FrequencyNavigation />
</Grid>
</Border>
</Grid>