Fix Binding at Theme (Preview Area)

This commit is contained in:
DB p 2024-05-24 00:06:54 +09:00
parent 7ccf109e3f
commit a9f7935b32

View file

@ -4,12 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions"
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions"
Title="Theme"
d:DataContext="{d:DesignInstance viewModels:SettingsPaneThemeViewModel}"
d:DesignHeight="450"
@ -25,22 +25,22 @@
</ResourceDictionary>
</ui:Page.Resources>
<ScrollViewer
Padding="6 0 24 0"
Padding="6,0,24,0"
CanContentScroll="True"
FontSize="14"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.ScrollUnit="Pixel">
<StackPanel>
<!-- Page title -->
<!-- Page title -->
<TextBlock
Margin="5 23 0 5"
Margin="5,23,0,5"
FontSize="30"
Style="{StaticResource PageTitle}"
Text="{DynamicResource appearance}"
TextAlignment="left"
Visibility="Collapsed" />
<!-- Theme preview -->
<!-- Theme preview -->
<StackPanel
Height="350"
Margin="0"
@ -71,25 +71,25 @@
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Query TextBox -->
<!-- Query TextBox -->
<TextBox
x:Name="QueryTextBox"
Grid.Row="0"
IsReadOnly="True"
Style="{DynamicResource QueryBoxStyle}"
Text="{DynamicResource hiThere}" />
<!-- Clock panel -->
<!-- Clock panel -->
<StackPanel
Grid.Row="0"
Style="{DynamicResource ClockPanel}"
Visibility="Visible">
<!-- Clock TextBox -->
<!-- Clock TextBox -->
<TextBlock
x:Name="ClockBox"
Style="{DynamicResource ClockBox}"
Text="{Binding ClockText}"
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
<!-- Date TextBox -->
<!-- Date TextBox -->
<TextBlock
x:Name="DateBox"
Style="{DynamicResource DateBox}"
@ -112,29 +112,31 @@
Visibility="Visible" />
<flowlauncher:ResultListBox
x:Name="ResultListBox"
Grid.Row="2"
DataContext="{Binding PreviewResults, Mode=OneTime}"
Visibility="Visible" />
<Border x:Name="ContextMenu" Visibility="Collapsed" />
<Border x:Name="History" Visibility="Collapsed" />
</Grid>
</Border>
</Border>
</StackPanel>
</StackPanel>
<!-- Drop shadow effect -->
<!-- Drop shadow effect -->
<cc:Card
Icon="&#xeb91;"
Title="{DynamicResource queryWindowShadowEffect}"
Sub="{DynamicResource shadowEffectCPUUsage}"
Margin="0 4 0 0">
Margin="0,4,0,0"
Icon="&#xeb91;"
Sub="{DynamicResource shadowEffectCPUUsage}">
<ui:ToggleSwitch
IsOn="{Binding DropShadowEffect}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<!-- Window width size -->
<!-- Window width size -->
<cc:Card
Title="{DynamicResource windowWidthSize}"
Icon="&#xe740;"
@ -142,7 +144,7 @@
<StackPanel Orientation="Horizontal">
<TextBlock
Width="Auto"
Margin="0 0 8 2"
Margin="0,0,8,2"
VerticalAlignment="Center"
Foreground="{DynamicResource Color05B}"
Text="{Binding WindowWidthSize}"
@ -159,10 +161,10 @@
</StackPanel>
</cc:Card>
<!-- Theme -->
<!-- Theme -->
<Border
Height="64"
Margin="0 8 0 0"
Margin="0,8,0,0"
CornerRadius="5 5 0 0"
Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
@ -179,7 +181,7 @@
Margin="0"
Padding="0"
HorizontalAlignment="Stretch"
BorderThickness="1 0 1 1"
BorderThickness="1,0,1,1"
CornerRadius="0 0 5 5"
Style="{DynamicResource SettingGroupBox}">
<ListBox
@ -195,10 +197,8 @@
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment"
Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment"
Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="4" />
<Setter Property="Template">
@ -209,13 +209,13 @@
Padding="{TemplateBinding Padding}"
Background="{DynamicResource Color12B}"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1 1 1 0"
BorderThickness="1,1,1,0"
CornerRadius="4"
SnapsToDevicePixels="true">
<Border
x:Name="Bd2"
BorderBrush="{DynamicResource Color14B}"
BorderThickness="0 0 0 2"
BorderThickness="0,0,0,2"
CornerRadius="4">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
@ -225,15 +225,12 @@
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Bd" Property="Background"
Value="{DynamicResource ThemeHoverButton}" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ThemeHoverButton}" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="Bd" Property="Background"
Value="{DynamicResource ToggleSwitchFillOn}" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ToggleSwitchFillOn}" />
<Setter TargetName="Bd2" Property="BorderThickness" Value="0" />
<Setter TargetName="Bd2" Property="TextElement.Foreground"
Value="{DynamicResource Color02B}" />
<Setter TargetName="Bd2" Property="TextElement.Foreground" Value="{DynamicResource Color02B}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@ -256,7 +253,7 @@
<TextBlock
x:Name="ThemeName"
Margin="0"
Padding="14 12"
Padding="14,12"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Focusable="True"
@ -278,21 +275,23 @@
<cc:HyperLink
Margin="10"
HorizontalAlignment="Right"
Uri="{Binding LinkThemeGallery}"
Text="{DynamicResource browserMoreThemes}" />
Text="{DynamicResource browserMoreThemes}"
Uri="{Binding LinkThemeGallery}" />
<!-- Fonts and icons -->
<cc:CardGroup Margin="0 30 0 0">
<cc:Card Icon="&#xf6b8;" Title="{DynamicResource useGlyphUI}"
Sub="{DynamicResource useGlyphUIEffect}">
<!-- Fonts and icons -->
<cc:CardGroup Margin="0,30,0,0">
<cc:Card
Title="{DynamicResource useGlyphUI}"
Icon="&#xf6b8;"
Sub="{DynamicResource useGlyphUIEffect}">
<ui:ToggleSwitch
IsOn="{Binding UseGlyphIcons}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:Card Icon="&#xe990;" Title="{DynamicResource queryBoxFont}">
<cc:Card Title="{DynamicResource queryBoxFont}" Icon="&#xe990;">
<StackPanel Orientation="Horizontal">
<ComboBox
Width="180"
@ -301,7 +300,7 @@
SelectedItem="{Binding SelectedQueryBoxFont}" />
<ComboBox
Width="130"
Margin="10 0 0 0"
Margin="10,0,0,0"
ItemsSource="{Binding SelectedQueryBoxFont.FamilyTypefaces}"
SelectedItem="{Binding SelectedQueryBoxFontFaces}">
<ComboBox.ItemTemplate>
@ -319,7 +318,7 @@
</StackPanel>
</cc:Card>
<cc:Card Icon="&#xe8fd;" Title="{DynamicResource resultItemFont}">
<cc:Card Title="{DynamicResource resultItemFont}" Icon="&#xe8fd;">
<StackPanel Orientation="Horizontal">
<ComboBox
Width="180"
@ -328,7 +327,7 @@
SelectedItem="{Binding SelectedResultFont}" />
<ComboBox
Width="130"
Margin="10 0 0 0"
Margin="10,0,0,0"
ItemsSource="{Binding SelectedResultFont.FamilyTypefaces}"
SelectedItem="{Binding SelectedResultFontFaces}">
<ComboBox.ItemTemplate>
@ -347,9 +346,9 @@
</cc:Card>
</cc:CardGroup>
<!-- Time and date -->
<cc:CardGroup Margin="0 24 0 0">
<cc:Card Icon="&#xec92;" Title="{DynamicResource Clock}">
<!-- Time and date -->
<cc:CardGroup Margin="0,24,0,0">
<cc:Card Title="{DynamicResource Clock}" Icon="&#xec92;">
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
@ -358,7 +357,7 @@
Text="{Binding ClockText}" />
<ComboBox
MinWidth="180"
Margin="10 0 18 0"
Margin="10,0,18,0"
VerticalAlignment="Center"
FontSize="14"
ItemsSource="{Binding TimeFormatList}"
@ -370,7 +369,7 @@
</StackPanel>
</cc:Card>
<cc:Card Icon="&#xe787;" Title="{DynamicResource Date}">
<cc:Card Title="{DynamicResource Date}" Icon="&#xe787;">
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
@ -379,7 +378,7 @@
Text="{Binding DateText}" />
<ComboBox
MinWidth="180"
Margin="10 0 18 0"
Margin="10,0,18,0"
VerticalAlignment="Center"
FontSize="14"
ItemsSource="{Binding DateFormatList}"
@ -392,11 +391,11 @@
</cc:Card>
</cc:CardGroup>
<!-- Animation -->
<cc:CardGroup Margin="0 11 0 0">
<!-- Animation -->
<cc:CardGroup Margin="0,11,0,0">
<cc:Card
Icon="&#xedb5;"
Title="{DynamicResource Animation}"
Icon="&#xedb5;"
Sub="{DynamicResource AnimationTip}">
<ui:ToggleSwitch
IsOn="{Binding UseAnimation}"
@ -404,8 +403,8 @@
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:Card
Icon="&#xe916;"
Title="{DynamicResource AnimationSpeed}"
Icon="&#xe916;"
Sub="{DynamicResource AnimationSpeedTip}"
Visibility="{Binding UseAnimation, Converter={StaticResource BoolToVisibilityConverter}}">
<StackPanel Orientation="Horizontal">
@ -419,32 +418,35 @@
SelectedValuePath="Value" />
<TextBox
Margin="18 0 0 0"
MinWidth="80"
Margin="18,0,0,0"
Text="{Binding Settings.CustomAnimationLength}"
TextWrapping="NoWrap"
Visibility="{ext:VisibleWhen
{Binding Settings.AnimationSpeed},
IsEqualTo={x:Static userSettings:AnimationSpeeds.Custom}}" />
Visibility="{ext:VisibleWhen {Binding Settings.AnimationSpeed},
IsEqualTo={x:Static userSettings:AnimationSpeeds.Custom}}" />
</StackPanel>
</cc:Card>
</cc:CardGroup>
<!-- SFX -->
<cc:CardGroup Margin="0 11 0 0">
<cc:Card Icon="&#xe7f5;" Title="{DynamicResource SoundEffect}"
Sub="{DynamicResource SoundEffectTip}">
<!-- SFX -->
<cc:CardGroup Margin="0,11,0,0">
<cc:Card
Title="{DynamicResource SoundEffect}"
Icon="&#xe7f5;"
Sub="{DynamicResource SoundEffectTip}">
<ui:ToggleSwitch
IsOn="{Binding UseSound}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:Card Icon="&#xe994;" Title="{DynamicResource SoundEffectVolume}"
Sub="{DynamicResource SoundEffectVolumeTip}"
Visibility="{Binding UseSound, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:Card
Title="{DynamicResource SoundEffectVolume}"
Icon="&#xe994;"
Sub="{DynamicResource SoundEffectVolumeTip}"
Visibility="{Binding UseSound, Converter={StaticResource BoolToVisibilityConverter}}">
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="0 0 8 0"
Margin="0,0,8,0"
VerticalAlignment="Center"
Text="{Binding SoundEffectVolume}" />
@ -461,8 +463,11 @@
</cc:Card>
</cc:CardGroup>
<!-- Settings color scheme -->
<cc:Card Icon="&#xe793;" Title="{DynamicResource ColorScheme}" Margin="0 11 0 0">
<!-- Settings color scheme -->
<cc:Card
Title="{DynamicResource ColorScheme}"
Margin="0,11,0,0"
Icon="&#xe793;">
<ComboBox
MinWidth="180"
DisplayMemberPath="Display"
@ -470,23 +475,23 @@
ItemsSource="{Binding ColorSchemes}"
SelectedValue="{Binding Settings.ColorScheme}"
SelectedValuePath="Value"
SelectionChanged="Selector_OnSelectionChanged"/>
SelectionChanged="Selector_OnSelectionChanged" />
</cc:Card>
<!-- Theme folder -->
<cc:Card Icon="&#xe838;" Title="{DynamicResource ThemeFolder}">
<!-- Theme folder -->
<cc:Card Title="{DynamicResource ThemeFolder}" Icon="&#xe838;">
<Button
MinWidth="180"
Command="{Binding OpenThemesFolderCommand}"
Content="{DynamicResource OpenThemeFolder}" />
</cc:Card>
<!-- How to create theme link -->
<!-- How to create theme link -->
<cc:HyperLink
Margin="10 10 10 28"
Margin="10,10,10,28"
HorizontalAlignment="Right"
Uri="{Binding LinkHowToCreateTheme}"
Text="{DynamicResource howToCreateTheme}" />
Text="{DynamicResource howToCreateTheme}"
Uri="{Binding LinkHowToCreateTheme}" />
</StackPanel>
</ScrollViewer>
</ui:Page>