mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Update plugin tab item base UI
This commit is contained in:
parent
3c235887d6
commit
1492bc9604
6 changed files with 38 additions and 23 deletions
|
|
@ -98,7 +98,7 @@
|
||||||
<TabItem Header="{DynamicResource plugin}">
|
<TabItem Header="{DynamicResource plugin}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200" />
|
<ColumnDefinition Width="215" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<DockPanel Grid.Column="0">
|
<DockPanel Grid.Column="0">
|
||||||
|
|
@ -153,37 +153,37 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="{Binding PluginPair.Metadata.Name}"
|
<TextBlock Text="{Binding PluginPair.Metadata.Name}"
|
||||||
ToolTip="{Binding PluginPair.Metadata.Name}"
|
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Cursor="Hand" MouseUp="OnPluginNameClick" FontSize="24"
|
Cursor="Hand" MouseUp="OnPluginNameClick" FontSize="24"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left">
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"
|
<ToolTipService.ToolTip>
|
||||||
VerticalAlignment="Bottom" Opacity="0.5">
|
<TextBlock>
|
||||||
<TextBlock Text="{DynamicResource author}" />
|
<Run Text="{DynamicResource author}" />
|
||||||
<TextBlock Text=": " />
|
<Run Text=": " />
|
||||||
<TextBlock Text="{Binding PluginPair.Metadata.Author}" ToolTip="{Binding PluginPair.Metadata.Author}" />
|
<Run Text="{Binding PluginPair.Metadata.Author}" />
|
||||||
</StackPanel>
|
</TextBlock>
|
||||||
|
</ToolTipService.ToolTip>
|
||||||
|
</TextBlock>
|
||||||
|
<ui:ToggleSwitch Grid.Column="1" OffContent="Disabled" OnContent="Enabled"
|
||||||
|
MaxWidth="110" HorizontalAlignment="Right"
|
||||||
|
IsOn="{Binding PluginState}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
|
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
|
||||||
ToolTip="{Binding PluginPair.Metadata.Description}"
|
|
||||||
Grid.Row="1" Opacity="0.5" />
|
Grid.Row="1" Opacity="0.5" />
|
||||||
<DockPanel Grid.Row="2" Margin="0 10 0 8">
|
<DockPanel Grid.Row="2" Margin="0 10 0 8" HorizontalAlignment="Right">
|
||||||
<CheckBox IsChecked="{Binding PluginPair.Metadata.Disabled}" Checked="OnPluginToggled"
|
|
||||||
Unchecked="OnPluginToggled">
|
|
||||||
<TextBlock Text="{DynamicResource disable}" />
|
|
||||||
</CheckBox>
|
|
||||||
<TextBlock Text="{DynamicResource actionKeywords}"
|
<TextBlock Text="{DynamicResource actionKeywords}"
|
||||||
Visibility="{Binding ActionKeywordsVisibility}"
|
Visibility="{Binding ActionKeywordsVisibility}"
|
||||||
Margin="20 0 0 0" />
|
Margin="20 0 0 0" MaxWidth="100"/>
|
||||||
<TextBlock Text="{Binding ActionKeywordsText}"
|
<TextBlock Text="{Binding ActionKeywordsText}"
|
||||||
Visibility="{Binding ActionKeywordsVisibility}"
|
Visibility="{Binding ActionKeywordsVisibility}"
|
||||||
ToolTip="Change Action Keywords"
|
ToolTip="Change Action Keywords"
|
||||||
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
||||||
MouseUp="OnPluginActionKeywordsClick" />
|
MouseUp="OnPluginActionKeywordsClick" MaxWidth="100" />
|
||||||
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" />
|
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||||
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" />
|
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||||
<TextBlock Text="{DynamicResource pluginDirectory}"
|
<TextBlock Text="{DynamicResource pluginDirectory}"
|
||||||
HorizontalAlignment="Right" Cursor="Hand"
|
MaxWidth="100" Cursor="Hand" Margin="40 0 0 0"
|
||||||
MouseUp="OnPluginDirecotyClick" Foreground="Blue" />
|
MouseUp="OnPluginDirecotyClick" Foreground="Blue" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,6 @@ namespace Flow.Launcher
|
||||||
private void OnClosed(object sender, EventArgs e)
|
private void OnClosed(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_viewModel.Save();
|
_viewModel.Save();
|
||||||
PluginManager.Save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,14 @@ namespace Flow.Launcher.ViewModel
|
||||||
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
||||||
|
|
||||||
public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath);
|
public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath);
|
||||||
|
public bool PluginState
|
||||||
|
{
|
||||||
|
get { return !PluginPair.Metadata.Disabled; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
PluginPair.Metadata.Disabled = !value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count > 1 ? Visibility.Collapsed : Visibility.Visible;
|
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count > 1 ? Visibility.Collapsed : Visibility.Visible;
|
||||||
public string InitilizaTime => string.Format(_translator.GetTranslation("plugin_init_time"), PluginPair.Metadata.InitTime);
|
public string InitilizaTime => string.Format(_translator.GetTranslation("plugin_init_time"), PluginPair.Metadata.InitTime);
|
||||||
public string QueryTime => string.Format(_translator.GetTranslation("plugin_query_time"), PluginPair.Metadata.AvgQueryTime);
|
public string QueryTime => string.Format(_translator.GetTranslation("plugin_query_time"), PluginPair.Metadata.AvgQueryTime);
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,14 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
foreach (var vm in PluginViewModels)
|
||||||
|
{
|
||||||
|
var id = vm.PluginPair.Metadata.ID;
|
||||||
|
|
||||||
|
Settings.PluginSettings.Plugins[id].Disabled = vm.PluginPair.Metadata.Disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
PluginManager.Save();
|
||||||
_storage.Save();
|
_storage.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
<system:String x:Key="flowlauncher_plugin_plugin_management_plugin_name">Flow Launcher Plugin Management</system:String>
|
<system:String x:Key="flowlauncher_plugin_plugin_management_plugin_name">Plugin Management</system:String>
|
||||||
<system:String x:Key="flowlauncher_plugin_plugin_management_plugin_description">Install, remove or update Flow Launcher plugins</system:String>
|
<system:String x:Key="flowlauncher_plugin_plugin_management_plugin_description">Install, remove or update Flow Launcher plugins</system:String>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"ID": "D2D2C23B084D422DB66FE0C79D6C2A6A",
|
"ID": "D2D2C23B084D422DB66FE0C79D6C2A6A",
|
||||||
"ActionKeyword": "wpm",
|
"ActionKeyword": "wpm",
|
||||||
"Name": "Flow Launcher Plugin Management",
|
"Name": "Plugin Management",
|
||||||
"Description": "Install/Remove/Update Flow Launcher plugins",
|
"Description": "Install/Remove/Update Flow Launcher plugins",
|
||||||
"Author": "qianlifeng",
|
"Author": "qianlifeng",
|
||||||
"Version": "1.0",
|
"Version": "1.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue