mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
142 lines
7 KiB
XML
142 lines
7 KiB
XML
<UserControl
|
|
x:Class="Flow.Launcher.Resources.Controls.InstalledPluginDisplay"
|
|
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:converters="clr-namespace:Flow.Launcher.Converters"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
|
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
|
|
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
|
|
d:DesignHeight="300"
|
|
d:DesignWidth="300"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
</UserControl.Resources>
|
|
<Expander
|
|
Padding="0"
|
|
BorderThickness="0"
|
|
ClipToBounds="True"
|
|
IsExpanded="{Binding Mode=TwoWay, Path=IsExpanded}"
|
|
SnapsToDevicePixels="True"
|
|
Style="{StaticResource ExpanderStyle1}">
|
|
<Expander.Header>
|
|
<Border Padding="0 12">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="36" MinWidth="36" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<Image
|
|
Grid.Column="0"
|
|
Width="32"
|
|
Height="32"
|
|
Source="{Binding Image, Mode=OneWay, IsAsync=True}" />
|
|
<StackPanel Grid.Column="1" Margin="16 0 14 0">
|
|
<TextBlock
|
|
Foreground="{DynamicResource Color05B}"
|
|
Text="{Binding PluginPair.Metadata.Name}"
|
|
TextWrapping="Wrap"
|
|
ToolTip="{Binding PluginPair.Metadata.Version}" />
|
|
<TextBlock
|
|
Margin="0 2 0 0"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource Color04B}"
|
|
Text="{Binding PluginPair.Metadata.Description}"
|
|
TextWrapping="WrapWithOverflow" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
Grid.Column="2"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<StackPanel
|
|
x:Name="PriorityControl"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal"
|
|
Visibility="{Binding DataContext.IsPrioritySelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock
|
|
Margin="0 0 8 0"
|
|
VerticalAlignment="Center"
|
|
FontSize="13"
|
|
Foreground="{DynamicResource Color08B}"
|
|
Text="{DynamicResource priority}"
|
|
ToolTip="{DynamicResource priorityToolTip}" />
|
|
<ui:NumberBox
|
|
Margin="0 0 8 0"
|
|
Maximum="999"
|
|
Minimum="-999"
|
|
SpinButtonPlacementMode="Inline"
|
|
ToolTip="{DynamicResource priorityToolTip}"
|
|
ValueChanged="NumberBox_OnValueChanged"
|
|
Value="{Binding Priority, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
x:Name="SearchDelayControl"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal"
|
|
Visibility="{Binding DataContext.IsSearchDelaySelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock
|
|
Margin="0 0 8 0"
|
|
VerticalAlignment="Center"
|
|
FontSize="13"
|
|
Foreground="{DynamicResource Color08B}"
|
|
Text="{DynamicResource searchDelay}"
|
|
ToolTip="{DynamicResource searchDelayToolTip}" />
|
|
<ui:NumberBox
|
|
Width="120"
|
|
Margin="0 0 8 0"
|
|
IsEnabled="{Binding SearchDelayEnabled}"
|
|
Maximum="1000"
|
|
Minimum="0"
|
|
PlaceholderText="{Binding DefaultSearchDelay}"
|
|
SmallChange="10"
|
|
SpinButtonPlacementMode="Compact"
|
|
ToolTip="{DynamicResource searchDelayToolTip}"
|
|
Value="{Binding PluginSearchDelayTime, Mode=TwoWay}" />
|
|
</StackPanel>
|
|
|
|
<!-- Put OnOffControl after PriorityControl & SearchDelayControl so that it can display correctly -->
|
|
<ui:ToggleSwitch
|
|
x:Name="OnOffControl"
|
|
Margin="0 0 8 0"
|
|
IsOn="{Binding PluginState}"
|
|
OffContent="{DynamicResource disable}"
|
|
OnContent="{DynamicResource enable}"
|
|
Visibility="{Binding DataContext.IsOnOffSelected, RelativeSource={RelativeSource AncestorType=ListBox}, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Expander.Header>
|
|
|
|
<StackPanel>
|
|
<ContentControl Content="{Binding BottomPart1}" />
|
|
|
|
<Border
|
|
Background="{DynamicResource Color00B}"
|
|
BorderBrush="{DynamicResource Color03B}"
|
|
BorderThickness="0 1 0 0">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding HasSettingControl}" Value="False">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<ContentControl
|
|
Margin="0"
|
|
Padding="1"
|
|
VerticalAlignment="Stretch"
|
|
Content="{Binding SettingControl}" />
|
|
</Border>
|
|
|
|
<ContentControl Content="{Binding BottomPart2}" />
|
|
</StackPanel>
|
|
</Expander>
|
|
</UserControl>
|