mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
491 lines
24 KiB
XML
491 lines
24 KiB
XML
<ui:Page
|
|
x:Class="Flow.Launcher.SettingPages.Views.SettingsPaneTheme"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
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: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"
|
|
d:DesignWidth="800"
|
|
Style="{DynamicResource SettingPageBasic}"
|
|
mc:Ignorable="d">
|
|
<ui:Page.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" />
|
|
</ResourceDictionary>
|
|
</ui:Page.Resources>
|
|
<ScrollViewer
|
|
Padding="6 0 24 0"
|
|
CanContentScroll="True"
|
|
FontSize="14"
|
|
VirtualizingStackPanel.IsVirtualizing="True"
|
|
VirtualizingStackPanel.ScrollUnit="Pixel">
|
|
<StackPanel>
|
|
<!-- Page title -->
|
|
<TextBlock
|
|
Margin="5 23 0 5"
|
|
FontSize="30"
|
|
Style="{StaticResource PageTitle}"
|
|
Text="{DynamicResource appearance}"
|
|
TextAlignment="left"
|
|
Visibility="Collapsed" />
|
|
|
|
<!-- Theme preview -->
|
|
<StackPanel
|
|
Height="350"
|
|
Margin="0"
|
|
Background="{Binding PreviewBackground}"
|
|
IsHitTestVisible="False">
|
|
<StackPanel
|
|
Margin="0,30,0,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<Border
|
|
Width="{Binding WindowWidthSize}"
|
|
Margin="0"
|
|
SnapsToDevicePixels="True"
|
|
Style="{DynamicResource WindowBorderStyle}"
|
|
UseLayoutRounding="True">
|
|
<Border Style="{DynamicResource WindowRadius}">
|
|
<Border.Clip>
|
|
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
|
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
|
|
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
|
|
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
|
|
</MultiBinding>
|
|
</Border.Clip>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<!-- Query TextBox -->
|
|
<TextBox
|
|
x:Name="QueryTextBox"
|
|
Grid.Row="0"
|
|
IsReadOnly="True"
|
|
Style="{DynamicResource QueryBoxStyle}"
|
|
Text="{DynamicResource hiThere}" />
|
|
<!-- Clock panel -->
|
|
<StackPanel
|
|
Grid.Row="0"
|
|
Style="{DynamicResource ClockPanel}"
|
|
Visibility="Visible">
|
|
<!-- Clock TextBox -->
|
|
<TextBlock
|
|
x:Name="ClockBox"
|
|
Style="{DynamicResource ClockBox}"
|
|
Text="{Binding ClockText}"
|
|
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
<!-- Date TextBox -->
|
|
<TextBlock
|
|
x:Name="DateBox"
|
|
Style="{DynamicResource DateBox}"
|
|
Text="{Binding DateText}"
|
|
Visibility="{Binding Settings.UseDate, Converter={StaticResource BoolToVisibilityConverter}}" />
|
|
</StackPanel>
|
|
<Canvas Grid.Row="0" Style="{DynamicResource SearchIconPosition}">
|
|
<Path
|
|
Margin="0"
|
|
Data="{DynamicResource SearchIconImg}"
|
|
Stretch="Fill"
|
|
Style="{DynamicResource SearchIconStyle}" />
|
|
</Canvas>
|
|
|
|
<Rectangle
|
|
Grid.Row="1"
|
|
Width="Auto"
|
|
HorizontalAlignment="Stretch"
|
|
Style="{DynamicResource SeparatorStyle}"
|
|
Visibility="Visible" />
|
|
|
|
<flowlauncher:ResultListBox
|
|
Grid.Row="2"
|
|
DataContext="{Binding PreviewResults, Mode=OneTime}"
|
|
Visibility="Visible" />
|
|
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<!-- Drop shadow effect -->
|
|
<cc:Card
|
|
Icon=""
|
|
Title="{DynamicResource queryWindowShadowEffect}"
|
|
Sub="{DynamicResource shadowEffectCPUUsage}"
|
|
Margin="0 4 0 0">
|
|
<ui:ToggleSwitch
|
|
IsOn="{Binding DropShadowEffect}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}" />
|
|
</cc:Card>
|
|
|
|
<!-- Window width size -->
|
|
<cc:Card
|
|
Title="{DynamicResource windowWidthSize}"
|
|
Icon=""
|
|
Sub="{DynamicResource windowWidthSizeToolTip}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Width="Auto"
|
|
Margin="0 0 8 2"
|
|
VerticalAlignment="Center"
|
|
Foreground="{DynamicResource Color05B}"
|
|
Text="{Binding WindowWidthSize}"
|
|
TextAlignment="Right" />
|
|
<Slider
|
|
Width="250"
|
|
VerticalAlignment="Center"
|
|
IsMoveToPointEnabled="True"
|
|
IsSnapToTickEnabled="True"
|
|
Maximum="1920"
|
|
Minimum="400"
|
|
TickFrequency="10"
|
|
Value="{Binding WindowWidthSize}" />
|
|
</StackPanel>
|
|
</cc:Card>
|
|
|
|
<!-- Theme -->
|
|
<Border
|
|
Height="64"
|
|
Margin="0 8 0 0"
|
|
CornerRadius="5 5 0 0"
|
|
Style="{DynamicResource SettingGroupBox}">
|
|
<ItemsControl Style="{StaticResource SettingGrid}">
|
|
<StackPanel Style="{StaticResource TextPanel}">
|
|
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource theme}" />
|
|
</StackPanel>
|
|
<TextBlock Style="{StaticResource Glyph}">
|
|

|
|
</TextBlock>
|
|
</ItemsControl>
|
|
</Border>
|
|
|
|
<Border
|
|
Margin="0"
|
|
Padding="0"
|
|
HorizontalAlignment="Stretch"
|
|
BorderThickness="1 0 1 1"
|
|
CornerRadius="0 0 5 5"
|
|
Style="{DynamicResource SettingGroupBox}">
|
|
<ListBox
|
|
Margin="12"
|
|
HorizontalAlignment="Center"
|
|
HorizontalContentAlignment="Center"
|
|
ui:ScrollViewerHelper.AutoHideScrollBars="True"
|
|
Background="#ffffff"
|
|
ItemsSource="{Binding Themes}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
|
SelectedItem="{Binding SelectedTheme}">
|
|
<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="Padding" Value="0" />
|
|
<Setter Property="Margin" Value="4" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
|
<Border
|
|
x:Name="Bd"
|
|
Padding="{TemplateBinding Padding}"
|
|
Background="{DynamicResource Color12B}"
|
|
BorderBrush="{DynamicResource Color03B}"
|
|
BorderThickness="1 1 1 0"
|
|
CornerRadius="4"
|
|
SnapsToDevicePixels="true">
|
|
<Border
|
|
x:Name="Bd2"
|
|
BorderBrush="{DynamicResource Color14B}"
|
|
BorderThickness="0 0 0 2"
|
|
CornerRadius="4">
|
|
<ContentPresenter
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Setter TargetName="Bd" Property="Background"
|
|
Value="{DynamicResource ThemeHoverButton}" />
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="true">
|
|
<Setter TargetName="Bd" Property="Background"
|
|
Value="{DynamicResource ToggleSwitchFillOn}" />
|
|
<Setter TargetName="Bd2" Property="BorderThickness" Value="0" />
|
|
<Setter TargetName="Bd2" Property="TextElement.Foreground"
|
|
Value="{DynamicResource Color02B}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
<ListBox.Template>
|
|
<!-- For Scroll Wheel inside listbox area -->
|
|
<ControlTemplate>
|
|
<ItemsPresenter />
|
|
</ControlTemplate>
|
|
</ListBox.Template>
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid
|
|
Width="Auto"
|
|
Height="34"
|
|
Margin="0">
|
|
<TextBlock
|
|
x:Name="ThemeName"
|
|
Margin="0"
|
|
Padding="14 12"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="True"
|
|
FontSize="12"
|
|
Text="{Binding}"
|
|
TextWrapping="Wrap" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
</ListBox>
|
|
|
|
</Border>
|
|
|
|
<cc:HyperLink
|
|
Margin="10"
|
|
HorizontalAlignment="Right"
|
|
Uri="{Binding LinkThemeGallery}"
|
|
Text="{DynamicResource browserMoreThemes}" />
|
|
|
|
|
|
<!-- Fonts and icons -->
|
|
<cc:CardGroup Margin="0 30 0 0">
|
|
<cc:Card Icon="" Title="{DynamicResource useGlyphUI}"
|
|
Sub="{DynamicResource useGlyphUIEffect}">
|
|
<ui:ToggleSwitch
|
|
IsOn="{Binding UseGlyphIcons}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}" />
|
|
</cc:Card>
|
|
|
|
<cc:Card Icon="" Title="{DynamicResource queryBoxFont}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<ComboBox
|
|
Width="180"
|
|
IsSynchronizedWithCurrentItem="False"
|
|
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
|
SelectedItem="{Binding SelectedQueryBoxFont}" />
|
|
<ComboBox
|
|
Width="130"
|
|
Margin="10 0 0 0"
|
|
ItemsSource="{Binding SelectedQueryBoxFont.FamilyTypefaces}"
|
|
SelectedItem="{Binding SelectedQueryBoxFontFaces}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<ItemsControl ItemsSource="{Binding AdjustedFaceNames}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Value}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
</cc:Card>
|
|
|
|
<cc:Card Icon="" Title="{DynamicResource resultItemFont}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<ComboBox
|
|
Width="180"
|
|
IsSynchronizedWithCurrentItem="False"
|
|
ItemsSource="{Binding Source={StaticResource SortedFonts}}"
|
|
SelectedItem="{Binding SelectedResultFont}" />
|
|
<ComboBox
|
|
Width="130"
|
|
Margin="10 0 0 0"
|
|
ItemsSource="{Binding SelectedResultFont.FamilyTypefaces}"
|
|
SelectedItem="{Binding SelectedResultFontFaces}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<ItemsControl ItemsSource="{Binding AdjustedFaceNames}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Value}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
</cc:Card>
|
|
</cc:CardGroup>
|
|
|
|
<!-- Time and date -->
|
|
<cc:CardGroup Margin="0 24 0 0">
|
|
<cc:Card Icon="" Title="{DynamicResource Clock}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Foreground="{DynamicResource Color04B}"
|
|
Text="{Binding ClockText}" />
|
|
<ComboBox
|
|
MinWidth="180"
|
|
Margin="10 0 18 0"
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
ItemsSource="{Binding TimeFormatList}"
|
|
SelectedItem="{Binding TimeFormat}" />
|
|
<ui:ToggleSwitch
|
|
IsOn="{Binding UseClock}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}" />
|
|
</StackPanel>
|
|
</cc:Card>
|
|
|
|
<cc:Card Icon="" Title="{DynamicResource Date}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
Foreground="{DynamicResource Color04B}"
|
|
Text="{Binding DateText}" />
|
|
<ComboBox
|
|
MinWidth="180"
|
|
Margin="10 0 18 0"
|
|
VerticalAlignment="Center"
|
|
FontSize="14"
|
|
ItemsSource="{Binding DateFormatList}"
|
|
SelectedItem="{Binding DateFormat}" />
|
|
<ui:ToggleSwitch
|
|
IsOn="{Binding UseDate}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}" />
|
|
</StackPanel>
|
|
</cc:Card>
|
|
</cc:CardGroup>
|
|
|
|
<!-- Animation -->
|
|
<cc:CardGroup Margin="0 11 0 0">
|
|
<cc:Card
|
|
Icon=""
|
|
Title="{DynamicResource Animation}"
|
|
Sub="{DynamicResource AnimationTip}">
|
|
<ui:ToggleSwitch
|
|
IsOn="{Binding UseAnimation}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}" />
|
|
</cc:Card>
|
|
<cc:Card
|
|
Icon=""
|
|
Title="{DynamicResource AnimationSpeed}"
|
|
Sub="{DynamicResource AnimationSpeedTip}"
|
|
Visibility="{Binding UseAnimation, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<ComboBox
|
|
MinWidth="160"
|
|
VerticalAlignment="Center"
|
|
DisplayMemberPath="Display"
|
|
FontSize="14"
|
|
ItemsSource="{Binding AnimationSpeeds}"
|
|
SelectedValue="{Binding Settings.AnimationSpeed}"
|
|
SelectedValuePath="Value" />
|
|
|
|
<TextBox
|
|
Margin="18 0 0 0"
|
|
MinWidth="80"
|
|
Text="{Binding Settings.CustomAnimationLength}"
|
|
TextWrapping="NoWrap"
|
|
Visibility="{ext:VisibleWhen
|
|
{Binding Settings.AnimationSpeed},
|
|
{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}">
|
|
<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}}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock
|
|
Margin="0 0 8 0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding SoundEffectVolume}" />
|
|
|
|
<Slider
|
|
Width="250"
|
|
VerticalAlignment="Center"
|
|
IsMoveToPointEnabled="True"
|
|
IsSnapToTickEnabled="True"
|
|
Maximum="100"
|
|
Minimum="0"
|
|
TickFrequency="1"
|
|
Value="{Binding SoundEffectVolume}" />
|
|
</StackPanel>
|
|
</cc:Card>
|
|
</cc:CardGroup>
|
|
|
|
<!-- Settings color scheme -->
|
|
<cc:Card Icon="" Title="{DynamicResource ColorScheme}" Margin="0 11 0 0">
|
|
<ComboBox
|
|
MinWidth="180"
|
|
DisplayMemberPath="Display"
|
|
FontSize="14"
|
|
ItemsSource="{Binding ColorSchemes}"
|
|
SelectedValue="{Binding Settings.ColorScheme}"
|
|
SelectedValuePath="Value" />
|
|
</cc:Card>
|
|
|
|
<!-- Theme folder -->
|
|
<cc:Card Icon="" Title="{DynamicResource ThemeFolder}">
|
|
<Button
|
|
MinWidth="180"
|
|
Command="{Binding OpenThemesFolderCommand}"
|
|
Content="{DynamicResource OpenThemeFolder}" />
|
|
</cc:Card>
|
|
|
|
<!-- How to create theme link -->
|
|
<cc:HyperLink
|
|
Margin="10 10 10 28"
|
|
HorizontalAlignment="Right"
|
|
Uri="{Binding LinkHowToCreateTheme}"
|
|
Text="{DynamicResource howToCreateTheme}" />
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</ui:Page>
|