mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix Binding at Theme (Preview Area)
This commit is contained in:
parent
7ccf109e3f
commit
a9f7935b32
1 changed files with 78 additions and 73 deletions
|
|
@ -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=""
|
||||
Title="{DynamicResource queryWindowShadowEffect}"
|
||||
Sub="{DynamicResource shadowEffectCPUUsage}"
|
||||
Margin="0 4 0 0">
|
||||
Margin="0,4,0,0"
|
||||
Icon=""
|
||||
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=""
|
||||
|
|
@ -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="" Title="{DynamicResource useGlyphUI}"
|
||||
Sub="{DynamicResource useGlyphUIEffect}">
|
||||
<!-- Fonts and icons -->
|
||||
<cc:CardGroup Margin="0,30,0,0">
|
||||
<cc:Card
|
||||
Title="{DynamicResource useGlyphUI}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource useGlyphUIEffect}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding UseGlyphIcons}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card Icon="" Title="{DynamicResource queryBoxFont}">
|
||||
<cc:Card Title="{DynamicResource queryBoxFont}" Icon="">
|
||||
<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="" Title="{DynamicResource resultItemFont}">
|
||||
<cc:Card Title="{DynamicResource resultItemFont}" Icon="">
|
||||
<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="" Title="{DynamicResource Clock}">
|
||||
<!-- Time and date -->
|
||||
<cc:CardGroup Margin="0,24,0,0">
|
||||
<cc:Card Title="{DynamicResource Clock}" Icon="">
|
||||
<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="" Title="{DynamicResource Date}">
|
||||
<cc:Card Title="{DynamicResource Date}" Icon="">
|
||||
<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=""
|
||||
Title="{DynamicResource Animation}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource AnimationTip}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding UseAnimation}"
|
||||
|
|
@ -404,8 +403,8 @@
|
|||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
<cc:Card
|
||||
Icon=""
|
||||
Title="{DynamicResource AnimationSpeed}"
|
||||
Icon=""
|
||||
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="" Title="{DynamicResource SoundEffect}"
|
||||
Sub="{DynamicResource SoundEffectTip}">
|
||||
<!-- SFX -->
|
||||
<cc:CardGroup Margin="0,11,0,0">
|
||||
<cc:Card
|
||||
Title="{DynamicResource SoundEffect}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource SoundEffectTip}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding UseSound}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
<cc:Card Icon="" Title="{DynamicResource SoundEffectVolume}"
|
||||
Sub="{DynamicResource SoundEffectVolumeTip}"
|
||||
Visibility="{Binding UseSound, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||
<cc:Card
|
||||
Title="{DynamicResource SoundEffectVolume}"
|
||||
Icon=""
|
||||
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="" Title="{DynamicResource ColorScheme}" Margin="0 11 0 0">
|
||||
<!-- Settings color scheme -->
|
||||
<cc:Card
|
||||
Title="{DynamicResource ColorScheme}"
|
||||
Margin="0,11,0,0"
|
||||
Icon="">
|
||||
<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="" Title="{DynamicResource ThemeFolder}">
|
||||
<!-- Theme folder -->
|
||||
<cc:Card Title="{DynamicResource ThemeFolder}" Icon="">
|
||||
<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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue