Adjust Base/Light Xaml / Add property /Fix Diffrence preview

This commit is contained in:
DB p 2022-11-23 12:02:10 +09:00
parent 9b9704cca7
commit e470445591
5 changed files with 284 additions and 178 deletions

View file

@ -1,4 +1,5 @@
<Window x:Class="Flow.Launcher.MainWindow"
<Window
x:Class="Flow.Launcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
@ -39,187 +40,200 @@
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Key="Escape"
Command="{Binding EscCommand}" />
<KeyBinding Key="F1"
Command="{Binding StartHelpCommand}" />
<KeyBinding Key="F5"
Command="{Binding ReloadPluginDataCommand}" />
<KeyBinding Key="Tab"
Command="{Binding AutocompleteQueryCommand}" />
<KeyBinding Key="Tab"
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}" />
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
<KeyBinding Key="Tab" Command="{Binding AutocompleteQueryCommand}" />
<KeyBinding
Key="Tab"
Command="{Binding AutocompleteQueryCommand}"
Modifiers="Shift" />
<KeyBinding Key="I"
<KeyBinding
Key="I"
Command="{Binding OpenSettingCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="N"
<KeyBinding
Key="N"
Command="{Binding SelectNextItemCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="J"
<KeyBinding
Key="J"
Command="{Binding SelectNextItemCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="D"
<KeyBinding
Key="D"
Command="{Binding SelectNextPageCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="P"
<KeyBinding
Key="P"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="K"
<KeyBinding
Key="K"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="U"
<KeyBinding
Key="U"
Command="{Binding SelectPrevPageCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Home"
<KeyBinding
Key="Home"
Command="{Binding SelectFirstResultCommand}"
Modifiers="Alt" />
<KeyBinding Key="O"
<KeyBinding
Key="O"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Right"
Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left"
Command="{Binding EscCommand}" />
<KeyBinding Key="H"
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
<KeyBinding
Key="H"
Command="{Binding LoadHistoryCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Right"
Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left"
Command="{Binding EscCommand}" />
<KeyBinding Key="OemCloseBrackets"
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
<KeyBinding
Key="OemCloseBrackets"
Command="{Binding IncreaseWidthCommand}"
Modifiers="Control" />
<KeyBinding Key="OemOpenBrackets"
<KeyBinding
Key="OemOpenBrackets"
Command="{Binding DecreaseWidthCommand}"
Modifiers="Control" />
<KeyBinding Key="OemPlus"
<KeyBinding
Key="OemPlus"
Command="{Binding IncreaseMaxResultCommand}"
Modifiers="Control" />
<KeyBinding Key="OemMinus"
<KeyBinding
Key="OemMinus"
Command="{Binding DecreaseMaxResultCommand}"
Modifiers="Control" />
<KeyBinding Key="H"
<KeyBinding
Key="H"
Command="{Binding LoadHistoryCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Enter"
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl+Shift" />
<KeyBinding Key="Enter"
<KeyBinding
Key="Enter"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Shift" />
<KeyBinding Key="Enter"
Command="{Binding OpenResultCommand}" />
<KeyBinding Key="Enter"
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Enter"
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Alt" />
<KeyBinding Key="D1"
<KeyBinding
Key="D1"
Command="{Binding OpenResultCommand}"
CommandParameter="0"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D2"
<KeyBinding
Key="D2"
Command="{Binding OpenResultCommand}"
CommandParameter="1"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D3"
<KeyBinding
Key="D3"
Command="{Binding OpenResultCommand}"
CommandParameter="2"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D4"
<KeyBinding
Key="D4"
Command="{Binding OpenResultCommand}"
CommandParameter="3"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D5"
<KeyBinding
Key="D5"
Command="{Binding OpenResultCommand}"
CommandParameter="4"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D6"
<KeyBinding
Key="D6"
Command="{Binding OpenResultCommand}"
CommandParameter="5"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D7"
<KeyBinding
Key="D7"
Command="{Binding OpenResultCommand}"
CommandParameter="6"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D8"
<KeyBinding
Key="D8"
Command="{Binding OpenResultCommand}"
CommandParameter="7"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D9"
<KeyBinding
Key="D9"
Command="{Binding OpenResultCommand}"
CommandParameter="8"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding Key="D0"
<KeyBinding
Key="D0"
Command="{Binding OpenResultCommand}"
CommandParameter="9"
Modifiers="{Binding OpenResultCommandModifiers}" />
</Window.InputBindings>
<Grid>
<Border MouseDown="OnMouseDown"
Style="{DynamicResource WindowBorderStyle}">
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
<StackPanel Orientation="Vertical">
<Grid>
<TextBox x:Name="QueryTextSuggestionBox"
<TextBox
x:Name="QueryTextSuggestionBox"
IsEnabled="False"
Style="{DynamicResource QuerySuggestionBoxStyle}">
<TextBox.Text>
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
<Binding ElementName="QueryTextBox"
Mode="OneTime" />
<Binding ElementName="ResultListBox"
Path="SelectedItem" />
<Binding ElementName="QueryTextBox"
Path="Text" />
<Binding ElementName="QueryTextBox" Mode="OneTime" />
<Binding ElementName="ResultListBox" Path="SelectedItem" />
<Binding ElementName="QueryTextBox" Path="Text" />
</MultiBinding>
</TextBox.Text>
</TextBox>
<TextBox x:Name="QueryTextBox"
<TextBox
x:Name="QueryTextBox"
AllowDrop="True"
Background="Transparent"
PreviewDragOver="OnPreviewDragOver"
PreviewKeyUp="QueryTextBox_KeyUp"
Style="{DynamicResource QueryBoxStyle}"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="Visible">
<TextBox.CommandBindings>
<CommandBinding Command="ApplicationCommands.Copy"
Executed="OnCopy" />
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
</TextBox.CommandBindings>
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Command="ApplicationCommands.Cut"
Header="{DynamicResource cut}">
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
<MenuItem.Icon>
<ui:FontIcon Glyph="&#xe8c6;" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Copy"
Header="{DynamicResource copy}">
<MenuItem Command="ApplicationCommands.Copy" Header="{DynamicResource copy}">
<MenuItem.Icon>
<ui:FontIcon Glyph="&#xe8c8;" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="ApplicationCommands.Paste"
Header="{DynamicResource paste}">
<MenuItem Command="ApplicationCommands.Paste" Header="{DynamicResource paste}">
<MenuItem.Icon>
<ui:FontIcon Glyph="&#xe77f;" />
</MenuItem.Icon>
</MenuItem>
<Separator Margin="0"
<Separator
Margin="0"
Padding="0,4,0,4"
Background="{DynamicResource ContextSeparator}" />
<MenuItem Click="OnContextMenusForSettingsClick"
Header="{DynamicResource flowlauncher_settings}">
<MenuItem Click="OnContextMenusForSettingsClick" Header="{DynamicResource flowlauncher_settings}">
<MenuItem.Icon>
<ui:FontIcon Glyph="&#xe713;" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="{Binding EscCommand}"
Header="{DynamicResource closeWindow}">
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}">
<MenuItem.Icon>
<ui:FontIcon Glyph="&#xe711;" />
</MenuItem.Icon>
@ -228,19 +242,23 @@
</TextBox.ContextMenu>
</TextBox>
<StackPanel x:Name="ClockPanel"
<StackPanel
x:Name="ClockPanel"
IsHitTestVisible="False"
Style="{DynamicResource ClockPanel}">
<TextBlock Style="{DynamicResource DateBox}"
<TextBlock
Style="{DynamicResource DateBox}"
Text="{Binding DateText}"
Visibility="{Binding Settings.UseDate, Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock Style="{DynamicResource ClockBox}"
<TextBlock
Style="{DynamicResource ClockBox}"
Text="{Binding ClockText}"
Visibility="{Binding Settings.UseClock, Converter={StaticResource BooleanToVisibilityConverter}}" />
</StackPanel>
<Canvas Style="{DynamicResource SearchIconPosition}">
<Image x:Name="PluginActivationIcon"
<Image
x:Name="PluginActivationIcon"
Width="32"
Height="32"
Margin="0,0,0,0"
@ -251,7 +269,8 @@
Source="{Binding PluginIconPath}"
Stretch="Uniform"
Style="{DynamicResource PluginActivationIcon}" />
<Path Name="SearchIcon"
<Path
Name="SearchIcon"
Margin="0"
Data="{DynamicResource SearchIconImg}"
Stretch="Fill"
@ -264,32 +283,27 @@
<ContentControl>
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Visibility"
Value="Collapsed" />
<Setter Property="Visibility" Value="Collapsed" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}"
Value="Visible">
<Setter Property="Visibility"
Value="Visible" />
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}"
Value="Visible">
<Setter Property="Visibility"
Value="Visible" />
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}"
Value="Visible">
<Setter Property="Visibility"
Value="Visible" />
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
<Setter Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
<Rectangle Width="Auto"
<Rectangle
Width="Auto"
HorizontalAlignment="Stretch"
Style="{DynamicResource SeparatorStyle}" />
</ContentControl>
<Line x:Name="ProgressBar"
<Line
x:Name="ProgressBar"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
Height="2"
HorizontalAlignment="Right"
@ -305,16 +319,14 @@
<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}" />
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox x:Name="ResultListBox"
<flowlauncher:ResultListBox
x:Name="ResultListBox"
DataContext="{Binding Results}"
LeftClickResultCommand="{Binding LeftClickResultCommand}"
RightClickResultCommand="{Binding RightClickResultCommand}" />
@ -323,16 +335,14 @@
<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}" />
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox x:Name="ContextMenu"
<flowlauncher:ResultListBox
x:Name="ContextMenu"
DataContext="{Binding ContextMenu}"
LeftClickResultCommand="{Binding LeftClickResultCommand}"
RightClickResultCommand="{Binding RightClickResultCommand}" />
@ -341,16 +351,14 @@
<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}" />
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox x:Name="History"
<flowlauncher:ResultListBox
x:Name="History"
DataContext="{Binding History}"
LeftClickResultCommand="{Binding LeftClickResultCommand}"
RightClickResultCommand="{Binding RightClickResultCommand}" />

View file

@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
MaxHeight="{Binding MaxHeight}"
Margin="{Binding Margin}"
Margin="{DynamicResource ResultMargin}"
HorizontalContentAlignment="Stretch"
d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
d:DesignHeight="100"
@ -17,6 +17,10 @@
ItemsSource="{Binding Results}"
KeyboardNavigation.DirectionalNavigation="Cycle"
PreviewMouseDown="ListBox_PreviewMouseDown"
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown"
PreviewMouseLeftButtonUp="ResultListBox_OnPreviewMouseUp"
PreviewMouseMove="ResultList_MouseMove"
PreviewMouseRightButtonDown="ResultListBox_OnPreviewMouseRightButtonDown"
SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
SelectionChanged="OnSelectionChanged"
@ -25,17 +29,12 @@
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Standard"
Visibility="{Binding Visbility}"
mc:Ignorable="d"
PreviewMouseMove="ResultList_MouseMove"
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown"
PreviewMouseLeftButtonUp="ResultListBox_OnPreviewMouseUp"
PreviewMouseRightButtonDown="ResultListBox_OnPreviewMouseRightButtonDown">
mc:Ignorable="d">
<!-- IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083 -->
<ListBox.ItemTemplate>
<DataTemplate>
<Button
HorizontalAlignment="Stretch">
<Button HorizontalAlignment="Stretch">
<Button.Template>
<ControlTemplate>
<ContentPresenter Content="{TemplateBinding Button.Content}" />
@ -89,13 +88,17 @@
x:Name="ImageIcon"
Width="{Binding IconXY}"
Height="{Binding IconXY}"
Margin="0,0,0,0" IsHitTestVisible="False"
Margin="0,0,0,0"
HorizontalAlignment="Center"
IsHitTestVisible="False"
Source="{Binding Image, TargetNullValue={x:Null}}"
Stretch="Uniform"
Visibility="{Binding ShowIcon}">
<Image.Clip>
<EllipseGeometry RadiusX="{Binding IconRadius}" RadiusY="{Binding IconRadius}" Center="16 16"/>
<EllipseGeometry
Center="16 16"
RadiusX="{Binding IconRadius}"
RadiusY="{Binding IconRadius}" />
</Image.Clip>
</Image>
</Border>
@ -104,6 +107,7 @@
BorderBrush="Transparent"
BorderThickness="0">
<TextBlock
x:Name="GlyphIcon"
Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
@ -125,11 +129,11 @@
Foreground="{Binding Result.ProgressBarColor}"
Value="{Binding ResultProgress, Mode=OneWay}">
<ProgressBar.Style>
<Style TargetType="ProgressBar" BasedOn="{StaticResource ProgressBarResult}">
<Setter Property="Visibility" Value="Visible"/>
<Style BasedOn="{StaticResource ProgressBarResult}" TargetType="ProgressBar">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding Result.ProgressBar}" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed"/>
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
@ -139,11 +143,11 @@
x:Name="Title"
VerticalAlignment="Center"
DockPanel.Dock="Left"
IsEnabled="False"
Style="{DynamicResource ItemTitleStyle}"
Text="{Binding Result.Title}"
ToolTip="{Binding ShowTitleToolTip}"
ToolTipService.ShowOnDisabled="True"
IsEnabled="False">
ToolTipService.ShowOnDisabled="True">
<vm:ResultsViewModel.FormattedText>
<MultiBinding Converter="{StaticResource HighlightTextConverter}">
<Binding Path="Result.Title" />
@ -155,10 +159,10 @@
x:Name="SubTitle"
Grid.Row="1"
IsEnabled="False"
ToolTipService.ShowOnDisabled="True"
Style="{DynamicResource ItemSubTitleStyle}"
Text="{Binding Result.SubTitle}"
ToolTip="{Binding ShowSubTitleToolTip}"/>
ToolTip="{Binding ShowSubTitleToolTip}"
ToolTipService.ShowOnDisabled="True" />
</Grid>
</Grid>
@ -171,6 +175,7 @@
<Setter TargetName="SubTitle" Property="Style" Value="{DynamicResource ItemSubTitleSelectedStyle}" />
<Setter TargetName="Hotkey" Property="Style" Value="{DynamicResource ItemHotkeySelectedStyle}" />
<Setter TargetName="ImageIcon" Property="Style" Value="{DynamicResource ItemImageSelectedStyle}" />
<Setter TargetName="GlyphIcon" Property="Style" Value="{DynamicResource ItemGlyphSelectedStyle}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
@ -189,8 +194,10 @@
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border
x:Name="Bd"
Margin="{DynamicResource ItemMargin}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{DynamicResource ItemRadius}"
SnapsToDevicePixels="True">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"

View file

@ -3,13 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
<CornerRadius x:Key="ItemRadius">8</CornerRadius>
<Thickness x:Key="ItemMargin">0</Thickness>
<Thickness x:Key="ResultMargin">0</Thickness>
<!-- Further font customisations are dynamically loaded in Theme.cs -->
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontSize" Value="28" />
<Setter Property="FontWeight" Value="Regular" />
<Setter Property="Margin" Value="16,7,0,7" />
<Setter Property="Margin" Value="16,7,16,7" />
<Setter Property="Padding" Value="0,4,68,0" />
<Setter Property="Background" Value="#2F2F2F" />
<Setter Property="Height" Value="48" />
@ -54,7 +56,7 @@
TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="DarkGray" />
<Setter Property="Height" Value="48" />
<Setter Property="Margin" Value="16,7,0,7" />
<Setter Property="Margin" Value="16,7,16,7" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0,4,68,0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
@ -197,6 +199,14 @@
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25" />
</Style>
<Style x:Key="BaseGlyphSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25" />
</Style>
<Style x:Key="BaseItemTitleSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />
@ -384,4 +394,15 @@
<Setter Property="Foreground" Value="#8f8f8f" />
<Setter Property="Opacity" Value="0.5" />
</Style>
<Style
x:Key="ItemGlyphSelectedStyle"
BasedOn="{StaticResource BaseGlyphSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25" />
</Style>
</ResourceDictionary>

View file

@ -1,73 +1,145 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml"></ResourceDictionary>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
<Style
x:Key="ItemGlyph"
BasedOn="{StaticResource BaseGlyphStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#9da1aa" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="White "/>
<Setter Property="Foreground" Value="#000000" />
<Setter Property="FontSize" Value="22" />
<Style
x:Key="QueryBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#999aa3" />
<Setter Property="Background" Value="red" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Height" Value="38" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="White"/>
<Style
x:Key="QuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}"
TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="38" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="#d9d9d9" />
<Setter Property="FontSize" Value="22" />
</Style>
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="LightGray" />
<Setter Property="BorderThickness" Value="1"></Setter>
<Setter Property="Background" Value="White"></Setter>
</Style>
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" >
</Style>
<Style x:Key="PendingLineStyle" BasedOn="{StaticResource BasePendingLineStyle}" TargetType="{x:Type Line}" >
<Style
x:Key="WindowBorderStyle"
BasedOn="{StaticResource BaseWindowBorderStyle}"
TargetType="{x:Type Border}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="White" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="UseLayoutRounding" Value="True" />
</Style>
<Style
x:Key="WindowStyle"
BasedOn="{StaticResource BaseWindowStyle}"
TargetType="{x:Type Window}" />
<Style
x:Key="PendingLineStyle"
BasedOn="{StaticResource BasePendingLineStyle}"
TargetType="{x:Type Line}" />
<!-- Item Style -->
<Style x:Key="ItemTitleStyle" BasedOn="{StaticResource BaseItemTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#000000"></Setter>
<!-- Item Style -->
<Style
x:Key="ItemTitleStyle"
BasedOn="{StaticResource BaseItemTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#3d434a" />
</Style>
<Style x:Key="ItemSubTitleStyle" BasedOn="{StaticResource BaseItemSubTitleStyle}" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#A8A8A8"></Setter>
<Style
x:Key="ItemSubTitleStyle"
BasedOn="{StaticResource BaseItemSubTitleStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#9da1aa" />
</Style>
<Style x:Key="ItemTitleSelectedStyle" BasedOn="{StaticResource BaseItemTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
<Style
x:Key="SeparatorStyle"
BasedOn="{StaticResource BaseSeparatorStyle}"
TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#f6f6f6" />
<Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="0,0,0,8" />
</Style>
<Style x:Key="ItemSubTitleSelectedStyle" BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#818181" />
<Style x:Key="HighlightStyle" />
<Style
x:Key="ItemTitleSelectedStyle"
BasedOn="{StaticResource BaseItemTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#d9d9d9</SolidColorBrush>
<Style
x:Key="ItemSubTitleSelectedStyle"
BasedOn="{StaticResource BaseItemSubTitleSelectedStyle}"
TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<SolidColorBrush x:Key="ItemSelectedBackgroundColor">#5046e5</SolidColorBrush>
<!-- button style in the middle of the scrollbar -->
<Style x:Key="ThumbStyle" BasedOn="{StaticResource BaseThumbStyle}" TargetType="{x:Type Thumb}">
<!-- button style in the middle of the scrollbar -->
<Style
x:Key="ThumbStyle"
BasedOn="{StaticResource BaseThumbStyle}"
TargetType="{x:Type Thumb}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border CornerRadius="2" DockPanel.Dock="Right" Background="#C3C3C3" BorderBrush="Transparent" BorderThickness="0" />
<Border
Background="#a0a8b5"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="2"
DockPanel.Dock="Right" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarStyle" BasedOn="{StaticResource BaseScrollBarStyle}" TargetType="{x:Type ScrollBar}">
<Style
x:Key="ScrollBarStyle"
BasedOn="{StaticResource BaseScrollBarStyle}"
TargetType="{x:Type ScrollBar}" />
<Style
x:Key="SearchIconStyle"
BasedOn="{StaticResource BaseSearchIconStyle}"
TargetType="{x:Type Path}">
<Setter Property="Fill" Value="#9da1aa" />
<Setter Property="Width" Value="24" />
<Setter Property="Height" Value="24" />
</Style>
<Style x:Key="SearchIconStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource BaseSearchIconStyle}">
<Setter Property="Fill" Value="#d9d9d9" />
<Style x:Key="SearchIconPosition" TargetType="{x:Type Canvas}">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0,8,8,0" />
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="ItemHotkeyStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#a3a3a3" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="#9da1aa" />
</Style>
<Style x:Key="ItemHotkeySelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="#a3a3a3" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="ItemGlyphSelectedStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25" />
</Style>
<CornerRadius x:Key="ItemRadius">8</CornerRadius>
<Thickness x:Key="ItemMargin">10 0 10 0</Thickness>
<Thickness x:Key="ResultMargin">0 0 0 10</Thickness>
</ResourceDictionary>

View file

@ -171,12 +171,10 @@ namespace Flow.Launcher.ViewModel
switch (Visbility)
{
case Visibility.Collapsed when Results.Count > 0:
Margin = new Thickness { Top = 0 };
SelectedIndex = 0;
Visbility = Visibility.Visible;
break;
case Visibility.Visible when Results.Count == 0:
Margin = new Thickness { Top = 0 };
Visbility = Visibility.Collapsed;
break;
}