mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
different width for image/video vs other file type
This commit is contained in:
parent
250627a27a
commit
d96ddd3e95
2 changed files with 184 additions and 172 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
<Window
|
<Window x:Class="Flow.Launcher.MainWindow"
|
||||||
x:Class="Flow.Launcher.MainWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
|
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
|
||||||
|
|
@ -39,166 +38,147 @@
|
||||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Window.InputBindings>
|
<Window.InputBindings>
|
||||||
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
|
<KeyBinding Key="Escape"
|
||||||
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}" />
|
Command="{Binding EscCommand}" />
|
||||||
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
|
<KeyBinding Key="F1"
|
||||||
<KeyBinding Key="Tab" Command="{Binding AutocompleteQueryCommand}" />
|
Command="{Binding StartHelpCommand}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="F5"
|
||||||
Key="Tab"
|
Command="{Binding ReloadPluginDataCommand}" />
|
||||||
|
<KeyBinding Key="Tab"
|
||||||
|
Command="{Binding AutocompleteQueryCommand}" />
|
||||||
|
<KeyBinding Key="Tab"
|
||||||
Command="{Binding AutocompleteQueryCommand}"
|
Command="{Binding AutocompleteQueryCommand}"
|
||||||
Modifiers="Shift" />
|
Modifiers="Shift" />
|
||||||
<KeyBinding
|
<KeyBinding Key="I"
|
||||||
Key="I"
|
|
||||||
Command="{Binding OpenSettingCommand}"
|
Command="{Binding OpenSettingCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="N"
|
||||||
Key="N"
|
|
||||||
Command="{Binding SelectNextItemCommand}"
|
Command="{Binding SelectNextItemCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="J"
|
||||||
Key="J"
|
|
||||||
Command="{Binding SelectNextItemCommand}"
|
Command="{Binding SelectNextItemCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D"
|
||||||
Key="D"
|
|
||||||
Command="{Binding SelectNextPageCommand}"
|
Command="{Binding SelectNextPageCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="P"
|
||||||
Key="P"
|
|
||||||
Command="{Binding SelectPrevItemCommand}"
|
Command="{Binding SelectPrevItemCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="K"
|
||||||
Key="K"
|
|
||||||
Command="{Binding SelectPrevItemCommand}"
|
Command="{Binding SelectPrevItemCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="U"
|
||||||
Key="U"
|
|
||||||
Command="{Binding SelectPrevPageCommand}"
|
Command="{Binding SelectPrevPageCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Home"
|
||||||
Key="Home"
|
|
||||||
Command="{Binding SelectFirstResultCommand}"
|
Command="{Binding SelectFirstResultCommand}"
|
||||||
Modifiers="Alt" />
|
Modifiers="Alt" />
|
||||||
<KeyBinding
|
<KeyBinding Key="O"
|
||||||
Key="O"
|
|
||||||
Command="{Binding LoadContextMenuCommand}"
|
Command="{Binding LoadContextMenuCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
|
<KeyBinding Key="Right"
|
||||||
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
|
Command="{Binding LoadContextMenuCommand}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Left"
|
||||||
Key="H"
|
Command="{Binding EscCommand}" />
|
||||||
|
<KeyBinding Key="H"
|
||||||
Command="{Binding LoadHistoryCommand}"
|
Command="{Binding LoadHistoryCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
|
<KeyBinding Key="Right"
|
||||||
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
|
Command="{Binding LoadContextMenuCommand}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Left"
|
||||||
Key="OemCloseBrackets"
|
Command="{Binding EscCommand}" />
|
||||||
|
<KeyBinding Key="OemCloseBrackets"
|
||||||
Command="{Binding IncreaseWidthCommand}"
|
Command="{Binding IncreaseWidthCommand}"
|
||||||
Modifiers="Control" />
|
Modifiers="Control" />
|
||||||
<KeyBinding
|
<KeyBinding Key="OemOpenBrackets"
|
||||||
Key="OemOpenBrackets"
|
|
||||||
Command="{Binding DecreaseWidthCommand}"
|
Command="{Binding DecreaseWidthCommand}"
|
||||||
Modifiers="Control" />
|
Modifiers="Control" />
|
||||||
<KeyBinding
|
<KeyBinding Key="OemPlus"
|
||||||
Key="OemPlus"
|
|
||||||
Command="{Binding IncreaseMaxResultCommand}"
|
Command="{Binding IncreaseMaxResultCommand}"
|
||||||
Modifiers="Control" />
|
Modifiers="Control" />
|
||||||
<KeyBinding
|
<KeyBinding Key="OemMinus"
|
||||||
Key="OemMinus"
|
|
||||||
Command="{Binding DecreaseMaxResultCommand}"
|
Command="{Binding DecreaseMaxResultCommand}"
|
||||||
Modifiers="Control" />
|
Modifiers="Control" />
|
||||||
<KeyBinding
|
<KeyBinding Key="H"
|
||||||
Key="H"
|
|
||||||
Command="{Binding LoadHistoryCommand}"
|
Command="{Binding LoadHistoryCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Enter"
|
||||||
Key="Enter"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
Modifiers="Ctrl+Shift" />
|
Modifiers="Ctrl+Shift" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Enter"
|
||||||
Key="Enter"
|
|
||||||
Command="{Binding LoadContextMenuCommand}"
|
Command="{Binding LoadContextMenuCommand}"
|
||||||
Modifiers="Shift" />
|
Modifiers="Shift" />
|
||||||
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
|
<KeyBinding Key="Enter"
|
||||||
<KeyBinding
|
Command="{Binding OpenResultCommand}" />
|
||||||
Key="Enter"
|
<KeyBinding Key="Enter"
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
Modifiers="Ctrl" />
|
Modifiers="Ctrl" />
|
||||||
<KeyBinding
|
<KeyBinding Key="Enter"
|
||||||
Key="Enter"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
Modifiers="Alt" />
|
Modifiers="Alt" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D1"
|
||||||
Key="D1"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="0"
|
CommandParameter="0"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D2"
|
||||||
Key="D2"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="1"
|
CommandParameter="1"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D3"
|
||||||
Key="D3"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="2"
|
CommandParameter="2"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D4"
|
||||||
Key="D4"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="3"
|
CommandParameter="3"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D5"
|
||||||
Key="D5"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="4"
|
CommandParameter="4"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D6"
|
||||||
Key="D6"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="5"
|
CommandParameter="5"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D7"
|
||||||
Key="D7"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="6"
|
CommandParameter="6"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D8"
|
||||||
Key="D8"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="7"
|
CommandParameter="7"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D9"
|
||||||
Key="D9"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="8"
|
CommandParameter="8"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
<KeyBinding
|
<KeyBinding Key="D0"
|
||||||
Key="D0"
|
|
||||||
Command="{Binding OpenResultCommand}"
|
Command="{Binding OpenResultCommand}"
|
||||||
CommandParameter="9"
|
CommandParameter="9"
|
||||||
Modifiers="{Binding OpenResultCommandModifiers}" />
|
Modifiers="{Binding OpenResultCommandModifiers}" />
|
||||||
</Window.InputBindings>
|
</Window.InputBindings>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
|
<Border MouseDown="OnMouseDown"
|
||||||
|
Style="{DynamicResource WindowBorderStyle}">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Border Style="{DynamicResource QueryBoxBgStyle}">
|
<Border Style="{DynamicResource QueryBoxBgStyle}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBox
|
<TextBox x:Name="QueryTextSuggestionBox"
|
||||||
x:Name="QueryTextSuggestionBox"
|
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
Style="{DynamicResource QuerySuggestionBoxStyle}">
|
Style="{DynamicResource QuerySuggestionBoxStyle}">
|
||||||
<TextBox.Text>
|
<TextBox.Text>
|
||||||
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
|
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
|
||||||
<Binding ElementName="QueryTextBox" Mode="OneTime" />
|
<Binding ElementName="QueryTextBox"
|
||||||
<Binding ElementName="ResultListBox" Path="SelectedItem" />
|
Mode="OneTime" />
|
||||||
<Binding ElementName="QueryTextBox" Path="Text" />
|
<Binding ElementName="ResultListBox"
|
||||||
|
Path="SelectedItem" />
|
||||||
|
<Binding ElementName="QueryTextBox"
|
||||||
|
Path="Text" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</TextBox.Text>
|
</TextBox.Text>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
<TextBox
|
<TextBox x:Name="QueryTextBox"
|
||||||
x:Name="QueryTextBox"
|
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
PreviewDragOver="OnPreviewDragOver"
|
PreviewDragOver="OnPreviewDragOver"
|
||||||
PreviewKeyUp="QueryTextBox_KeyUp"
|
PreviewKeyUp="QueryTextBox_KeyUp"
|
||||||
|
|
@ -206,35 +186,40 @@
|
||||||
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
Visibility="Visible">
|
Visibility="Visible">
|
||||||
<TextBox.CommandBindings>
|
<TextBox.CommandBindings>
|
||||||
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />
|
<CommandBinding Command="ApplicationCommands.Copy"
|
||||||
|
Executed="OnCopy" />
|
||||||
</TextBox.CommandBindings>
|
</TextBox.CommandBindings>
|
||||||
<TextBox.ContextMenu>
|
<TextBox.ContextMenu>
|
||||||
<ContextMenu MinWidth="160">
|
<ContextMenu MinWidth="160">
|
||||||
<MenuItem Command="ApplicationCommands.Cut" Header="{DynamicResource cut}">
|
<MenuItem Command="ApplicationCommands.Cut"
|
||||||
|
Header="{DynamicResource cut}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<ui:FontIcon Glyph="" />
|
<ui:FontIcon Glyph="" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Command="ApplicationCommands.Copy" Header="{DynamicResource copy}">
|
<MenuItem Command="ApplicationCommands.Copy"
|
||||||
|
Header="{DynamicResource copy}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<ui:FontIcon Glyph="" />
|
<ui:FontIcon Glyph="" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Command="ApplicationCommands.Paste" Header="{DynamicResource paste}">
|
<MenuItem Command="ApplicationCommands.Paste"
|
||||||
|
Header="{DynamicResource paste}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<ui:FontIcon Glyph="" />
|
<ui:FontIcon Glyph="" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator
|
<Separator Margin="0"
|
||||||
Margin="0"
|
|
||||||
Padding="0,4,0,4"
|
Padding="0,4,0,4"
|
||||||
Background="{DynamicResource ContextSeparator}" />
|
Background="{DynamicResource ContextSeparator}" />
|
||||||
<MenuItem Click="OnContextMenusForSettingsClick" Header="{DynamicResource flowlauncher_settings}">
|
<MenuItem Click="OnContextMenusForSettingsClick"
|
||||||
|
Header="{DynamicResource flowlauncher_settings}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<ui:FontIcon Glyph="" />
|
<ui:FontIcon Glyph="" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}">
|
<MenuItem Command="{Binding EscCommand}"
|
||||||
|
Header="{DynamicResource closeWindow}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<ui:FontIcon Glyph="" />
|
<ui:FontIcon Glyph="" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
|
|
@ -244,25 +229,21 @@
|
||||||
</TextBox>
|
</TextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<StackPanel
|
<StackPanel x:Name="ClockPanel"
|
||||||
x:Name="ClockPanel"
|
|
||||||
IsHitTestVisible="False"
|
IsHitTestVisible="False"
|
||||||
Style="{DynamicResource ClockPanel}">
|
Style="{DynamicResource ClockPanel}">
|
||||||
<TextBlock
|
<TextBlock x:Name="ClockBox"
|
||||||
x:Name="ClockBox"
|
|
||||||
Style="{DynamicResource ClockBox}"
|
Style="{DynamicResource ClockBox}"
|
||||||
Text="{Binding ClockText}"
|
Text="{Binding ClockText}"
|
||||||
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
|
Visibility="{Binding Settings.UseClock, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
<TextBlock
|
<TextBlock x:Name="DateBox"
|
||||||
x:Name="DateBox"
|
|
||||||
Style="{DynamicResource DateBox}"
|
Style="{DynamicResource DateBox}"
|
||||||
Text="{Binding DateText}"
|
Text="{Binding DateText}"
|
||||||
Visibility="{Binding Settings.UseDate, Converter={StaticResource BoolToVisibilityConverter}}" />
|
Visibility="{Binding Settings.UseDate, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border>
|
<Border>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image
|
<Image x:Name="PluginActivationIcon"
|
||||||
x:Name="PluginActivationIcon"
|
|
||||||
Width="32"
|
Width="32"
|
||||||
Height="32"
|
Height="32"
|
||||||
Margin="0,0,18,0"
|
Margin="0,0,18,0"
|
||||||
|
|
@ -274,8 +255,7 @@
|
||||||
Stretch="Uniform"
|
Stretch="Uniform"
|
||||||
Style="{DynamicResource PluginActivationIcon}" />
|
Style="{DynamicResource PluginActivationIcon}" />
|
||||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||||
<Path
|
<Path Name="SearchIcon"
|
||||||
Name="SearchIcon"
|
|
||||||
Margin="0"
|
Margin="0"
|
||||||
Data="{DynamicResource SearchIconImg}"
|
Data="{DynamicResource SearchIconImg}"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
|
|
@ -290,28 +270,33 @@
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<ContentControl.Style>
|
<ContentControl.Style>
|
||||||
<Style TargetType="ContentControl">
|
<Style TargetType="ContentControl">
|
||||||
<Setter Property="Visibility" Value="Collapsed" />
|
<Setter Property="Visibility"
|
||||||
|
Value="Collapsed" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}" Value="Visible">
|
<DataTrigger Binding="{Binding ElementName=ResultListBox, Path=Visibility}"
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
Value="Visible">
|
||||||
|
<Setter Property="Visibility"
|
||||||
|
Value="Visible" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}" Value="Visible">
|
<DataTrigger Binding="{Binding ElementName=ContextMenu, Path=Visibility}"
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
Value="Visible">
|
||||||
|
<Setter Property="Visibility"
|
||||||
|
Value="Visible" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}" Value="Visible">
|
<DataTrigger Binding="{Binding ElementName=History, Path=Visibility}"
|
||||||
<Setter Property="Visibility" Value="Visible" />
|
Value="Visible">
|
||||||
|
<Setter Property="Visibility"
|
||||||
|
Value="Visible" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</ContentControl.Style>
|
</ContentControl.Style>
|
||||||
<Rectangle
|
<Rectangle Name="MiddleSeparator"
|
||||||
Name="MiddleSeparator"
|
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Style="{DynamicResource SeparatorStyle}" />
|
Style="{DynamicResource SeparatorStyle}" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
<Line
|
<Line x:Name="ProgressBar"
|
||||||
x:Name="ProgressBar"
|
|
||||||
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
|
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
|
||||||
Height="2"
|
Height="2"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
|
|
@ -326,23 +311,25 @@
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="0.75*" MinWidth="250" />
|
<ColumnDefinition Width="0.75*"
|
||||||
|
MinWidth="250" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel
|
<StackPanel x:Name="ResultArea"
|
||||||
x:Name="ResultArea"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2">
|
Grid.ColumnSpan="2">
|
||||||
<Border Style="{DynamicResource WindowRadius}">
|
<Border Style="{DynamicResource WindowRadius}">
|
||||||
<Border.Clip>
|
<Border.Clip>
|
||||||
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
||||||
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualWidth"
|
||||||
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
|
RelativeSource="{RelativeSource Self}" />
|
||||||
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualHeight"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
|
<Binding Path="CornerRadius"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Border.Clip>
|
</Border.Clip>
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<flowlauncher:ResultListBox
|
<flowlauncher:ResultListBox x:Name="ResultListBox"
|
||||||
x:Name="ResultListBox"
|
|
||||||
DataContext="{Binding Results}"
|
DataContext="{Binding Results}"
|
||||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||||
|
|
@ -351,14 +338,16 @@
|
||||||
<Border Style="{DynamicResource WindowRadius}">
|
<Border Style="{DynamicResource WindowRadius}">
|
||||||
<Border.Clip>
|
<Border.Clip>
|
||||||
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
||||||
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualWidth"
|
||||||
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
|
RelativeSource="{RelativeSource Self}" />
|
||||||
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualHeight"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
|
<Binding Path="CornerRadius"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Border.Clip>
|
</Border.Clip>
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<flowlauncher:ResultListBox
|
<flowlauncher:ResultListBox x:Name="ContextMenu"
|
||||||
x:Name="ContextMenu"
|
|
||||||
DataContext="{Binding ContextMenu}"
|
DataContext="{Binding ContextMenu}"
|
||||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||||
|
|
@ -367,52 +356,64 @@
|
||||||
<Border Style="{DynamicResource WindowRadius}">
|
<Border Style="{DynamicResource WindowRadius}">
|
||||||
<Border.Clip>
|
<Border.Clip>
|
||||||
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
<MultiBinding Converter="{StaticResource BorderClipConverter}">
|
||||||
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualWidth"
|
||||||
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
|
RelativeSource="{RelativeSource Self}" />
|
||||||
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
|
<Binding Path="ActualHeight"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
|
<Binding Path="CornerRadius"
|
||||||
|
RelativeSource="{RelativeSource Self}" />
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Border.Clip>
|
</Border.Clip>
|
||||||
<ContentControl>
|
<ContentControl>
|
||||||
<flowlauncher:ResultListBox
|
<flowlauncher:ResultListBox x:Name="History"
|
||||||
x:Name="History"
|
|
||||||
DataContext="{Binding History}"
|
DataContext="{Binding History}"
|
||||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||||
</ContentControl>
|
</ContentControl>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid
|
<Grid x:Name="Preview"
|
||||||
x:Name="Preview"
|
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
|
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
|
||||||
DataContext="{Binding SelectedItem, ElementName=ResultListBox}"
|
DataContext="{Binding SelectedItem, ElementName=ResultListBox}"
|
||||||
Style="{DynamicResource PreviewArea}"
|
Style="{DynamicResource PreviewArea}"
|
||||||
Visibility="Collapsed">
|
Visibility="Collapsed">
|
||||||
<Border Style="{DynamicResource PreviewBorderStyle}" Visibility="{Binding ShowDefaultPreview}">
|
<Border Style="{DynamicResource PreviewBorderStyle}"
|
||||||
<Grid
|
Visibility="{Binding ShowDefaultPreview}">
|
||||||
Margin="20,0,10,0"
|
<Grid Margin="20,0,10,0"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
Background="Transparent">
|
Background="Transparent">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" MinHeight="240" />
|
<RowDefinition Height="Auto"
|
||||||
|
MinHeight="240" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel
|
<StackPanel Grid.Row="0"
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<Image
|
<Image x:Name="ImageIcon"
|
||||||
x:Name="ImageIcon"
|
MinHeight="128"
|
||||||
MinHeight="64"
|
|
||||||
MaxWidth="{Binding ActualWidth, ElementName=Preview}"
|
|
||||||
MaxHeight="400"
|
MaxHeight="400"
|
||||||
Margin="0,10,0,4"
|
Margin="0,10,0,4"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Source="{Binding PreviewImage}"
|
Source="{Binding PreviewImage}"
|
||||||
Visibility="{Binding ShowIcon}" />
|
Visibility="{Binding ShowIcon}">
|
||||||
<TextBlock
|
<Image.Style>
|
||||||
x:Name="PreviewTitle"
|
<Style TargetType="{x:Type Image}">
|
||||||
|
<Setter Property="MaxWidth"
|
||||||
|
Value="128" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding PreviewIsImageOrVideo}"
|
||||||
|
Value="True">
|
||||||
|
<Setter Property="MaxWidth"
|
||||||
|
Value="{Binding ElementName=Preview, Path=ActualWidth}" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Image.Style>
|
||||||
|
</Image>
|
||||||
|
<TextBlock x:Name="PreviewTitle"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Style="{DynamicResource PreviewItemTitleStyle}"
|
Style="{DynamicResource PreviewItemTitleStyle}"
|
||||||
Text="{Binding Result.Title}"
|
Text="{Binding Result.Title}"
|
||||||
|
|
@ -421,14 +422,14 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Grid.Row="1">
|
<StackPanel Grid.Row="1">
|
||||||
<Separator Style="{DynamicResource PreviewSep}" />
|
<Separator Style="{DynamicResource PreviewSep}" />
|
||||||
<TextBlock
|
<TextBlock x:Name="PreviewSubTitle"
|
||||||
x:Name="PreviewSubTitle"
|
|
||||||
Style="{DynamicResource PreviewItemSubTitleStyle}"
|
Style="{DynamicResource PreviewItemSubTitleStyle}"
|
||||||
Text="{Binding Result.SubTitle}" />
|
Text="{Binding Result.SubTitle}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
<ContentControl Content="{Binding Result.PreviewPanel.Value}" Visibility="{Binding ShowCustomizedPrewview}" />
|
<ContentControl Content="{Binding Result.PreviewPanel.Value}"
|
||||||
|
Visibility="{Binding ShowCustomizedPrewview}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,16 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
public ResultViewModel(Result result, Settings settings)
|
public ResultViewModel(Result result, Settings settings)
|
||||||
{
|
{
|
||||||
if (result != null)
|
Settings = settings;
|
||||||
|
|
||||||
|
if (result == null)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
Result = result;
|
Result = result;
|
||||||
|
|
||||||
|
PreviewExtension = Path.GetExtension(result.PreviewImage ?? result.IcoPath);
|
||||||
|
|
||||||
if (Result.Glyph is { FontFamily: not null } glyph)
|
if (Result.Glyph is { FontFamily: not null } glyph)
|
||||||
{
|
{
|
||||||
// Checks if it's a system installed font, which does not require path to be provided.
|
// Checks if it's a system installed font, which does not require path to be provided.
|
||||||
|
|
@ -58,9 +64,7 @@ namespace Flow.Launcher.ViewModel
|
||||||
Glyph = glyph;
|
Glyph = glyph;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Settings = settings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Settings Settings { get; }
|
private Settings Settings { get; }
|
||||||
|
|
@ -165,6 +169,13 @@ namespace Flow.Launcher.ViewModel
|
||||||
private set => previewImage = value;
|
private set => previewImage = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string PreviewExtension { get; set; }
|
||||||
|
|
||||||
|
public bool PreviewIsImageOrVideo => PreviewExtension is ".jpg"
|
||||||
|
or ".png"
|
||||||
|
or ".gif"
|
||||||
|
or ".mp4";
|
||||||
|
|
||||||
public GlyphInfo Glyph { get; set; }
|
public GlyphInfo Glyph { get; set; }
|
||||||
|
|
||||||
private async Task LoadImageAsync()
|
private async Task LoadImageAsync()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue