Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 2 additions & 105 deletions Flow.Launcher/Resources/Controls/InstalledPluginDisplay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,42 +93,7 @@
</Expander.Header>

<StackPanel>
<Border
Width="Auto"
Height="52"
Margin="0"
Padding="0"
BorderThickness="0 1 0 0"
CornerRadius="0"
Style="{DynamicResource SettingGroupBox}"
Visibility="{Binding ActionKeywordsVisibility}">
<DockPanel Margin="22 0 18 0" VerticalAlignment="Center">
<TextBlock
Margin="48 0 10 0"
DockPanel.Dock="Left"
Style="{StaticResource Glyph}">
&#xe819;
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Center"
DockPanel.Dock="Left"
Style="{DynamicResource SettingTitleLabel}"
Text="{DynamicResource actionKeywords}" />
<Button
Width="100"
Height="34"
Margin="5 0 0 0"
HorizontalAlignment="Right"
Command="{Binding SetActionKeywordsCommand}"
Content="{Binding ActionKeywordsText}"
Cursor="Hand"
DockPanel.Dock="Right"
FontWeight="Bold"
ToolTip="{DynamicResource actionKeywordsTooltip}"
Visibility="{Binding ActionKeywordsVisibility}" />
</DockPanel>
</Border>
<ContentControl Content="{Binding BottomPart1}" />

<Border
BorderThickness="0 1 0 0"
Expand All @@ -150,75 +115,7 @@
Content="{Binding SettingControl}" />
</Border>

<Border
Margin="0"
Padding="15 10"
VerticalAlignment="Center"
BorderThickness="0 1 0 0"
CornerRadius="0 0 5 5"
Style="{DynamicResource SettingGroupBox}">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock
Margin="10 0 0 0"
VerticalAlignment="center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{DynamicResource author}" />
<TextBlock
Margin="5 0 0 0"
VerticalAlignment="center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{Binding PluginPair.Metadata.Author}" />
<TextBlock
Margin="10 0 0 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="|" />
<TextBlock
Margin="10 0 5 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{Binding Version}"
ToolTip="{Binding InitAndQueryTime}"
ToolTipService.InitialShowDelay="500" />
<TextBlock
Margin="5 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="|" />
<TextBlock
Margin="5 0 0 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe80f;"
ToolTip="{DynamicResource plugin_query_web}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenSourceCodeLinkCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
<TextBlock
Margin="10 0 0 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe74d;"
ToolTip="{DynamicResource plugin_uninstall}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenDeletePluginWindowCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
<TextBlock
Margin="10 0 5 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe8b7;"
ToolTip="{DynamicResource pluginDirectory}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenPluginDirectoryCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
</StackPanel>
</Border>
<ContentControl Content="{Binding BottomPart2}" />
</StackPanel>
</Expander>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.InstalledPluginDisplayBottomData"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Border
Margin="0"
Padding="15 10"
VerticalAlignment="Center"
BorderThickness="0 1 0 0"
CornerRadius="0 0 5 5"
Style="{DynamicResource SettingGroupBox}">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<TextBlock
Margin="10 0 0 0"
VerticalAlignment="center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{DynamicResource author}" />
<TextBlock
Margin="5 0 0 0"
VerticalAlignment="center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{Binding PluginPair.Metadata.Author}" />
<TextBlock
Margin="10 0 0 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="|" />
<TextBlock
Margin="10 0 5 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="{Binding Version}"
ToolTip="{Binding InitAndQueryTime}"
ToolTipService.InitialShowDelay="500" />
<TextBlock
Margin="5 0"
VerticalAlignment="Center"
FontSize="11"
Foreground="{DynamicResource PluginInfoColor}"
Text="|" />
<TextBlock
Margin="5 0 0 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe80f;"
ToolTip="{DynamicResource plugin_query_web}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenSourceCodeLinkCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
<TextBlock
Margin="10 0 0 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe74d;"
ToolTip="{DynamicResource plugin_uninstall}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenDeletePluginWindowCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
<TextBlock
Margin="10 0 5 0"
Style="{DynamicResource LinkBtnStyle}"
Text="&#xe8b7;"
ToolTip="{DynamicResource pluginDirectory}">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding OpenPluginDirectoryCommand}" MouseAction="LeftClick" />
</TextBlock.InputBindings>
</TextBlock>
</StackPanel>
</Border>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Windows.Controls;

namespace Flow.Launcher.Resources.Controls;

public partial class InstalledPluginDisplayBottomData : UserControl
{
public InstalledPluginDisplayBottomData()
{
InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.InstalledPluginDisplayKeyword"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
d:DesignHeight="300"
d:DesignWidth="300"
mc:Ignorable="d">
<Border
Width="Auto"
Height="52"
Margin="0"
Padding="0"
BorderThickness="0 1 0 0"
CornerRadius="0"
Style="{DynamicResource SettingGroupBox}"
Visibility="{Binding ActionKeywordsVisibility}">
<DockPanel Margin="22 0 18 0" VerticalAlignment="Center">
<TextBlock
Margin="48 0 10 0"
DockPanel.Dock="Left"
Style="{StaticResource Glyph}">
&#xe819;
</TextBlock>
<TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Center"
DockPanel.Dock="Left"
Style="{DynamicResource SettingTitleLabel}"
Text="{DynamicResource actionKeywords}" />
<Button
Width="100"
Height="34"
Margin="5 0 0 0"
HorizontalAlignment="Right"
Command="{Binding SetActionKeywordsCommand}"
Content="{Binding ActionKeywordsText}"
Cursor="Hand"
DockPanel.Dock="Right"
FontWeight="Bold"
ToolTip="{DynamicResource actionKeywordsTooltip}" />
</DockPanel>
</Border>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Windows.Controls;

namespace Flow.Launcher.Resources.Controls;

public partial class InstalledPluginDisplayKeyword : UserControl
{
public InstalledPluginDisplayKeyword()
{
InitializeComponent();
}
}
7 changes: 7 additions & 0 deletions Flow.Launcher/ViewModel/PluginViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Windows.Controls;
using CommunityToolkit.Mvvm.Input;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Resources.Controls;

namespace Flow.Launcher.ViewModel
{
Expand Down Expand Up @@ -83,6 +84,12 @@ public bool IsExpanded
private Control _settingControl;
private bool _isExpanded;

private Control _bottomPart1;
public Control BottomPart1 => IsExpanded ? _bottomPart1 ??= new InstalledPluginDisplayKeyword() : null;

private Control _bottomPart2;
public Control BottomPart2 => IsExpanded ? _bottomPart2 ??= new InstalledPluginDisplayBottomData() : null;

public bool HasSettingControl => PluginPair.Plugin is ISettingProvider;
public Control SettingControl
=> IsExpanded
Expand Down