Flow.Launcher/Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml
2025-03-21 07:58:00 +08:00

126 lines
6 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: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">
<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">
<TextBlock
Margin="0 0 8 0"
VerticalAlignment="Center"
FontSize="12"
Foreground="{DynamicResource Color08B}"
Text="{DynamicResource priority}" />
<Button
x:Name="PriorityButton"
Margin="0 0 22 0"
VerticalAlignment="Center"
Command="{Binding EditPluginPriorityCommand}"
Content="{Binding Priority}"
Cursor="Hand"
ToolTip="{DynamicResource priorityToolTip}">
<!--#region Priority Button Style-->
<Button.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2" />
</Style>
</Button.Resources>
<Button.Style>
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
<Setter Property="Padding" Value="12 8" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=PriorityButton, UpdateSourceTrigger=PropertyChanged, Path=Content}" Value="0">
<Setter Property="Foreground" Value="{DynamicResource Color08B}" />
<Setter Property="FontWeight" Value="Normal" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<!--#endregion-->
</Button>
<ui:ToggleSwitch
Margin="0 0 8 0"
IsOn="{Binding PluginState}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</StackPanel>
</Grid>
</Border>
</Expander.Header>
<StackPanel>
<ContentControl Content="{Binding BottomPart1}" />
<ContentControl Content="{Binding BottomPart2}" />
<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 BottomPart3}" />
</StackPanel>
</Expander>
</UserControl>