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}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="215" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel Grid.Column="0">
|
||||
|
|
@ -153,37 +153,37 @@
|
|||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding PluginPair.Metadata.Name}"
|
||||
ToolTip="{Binding PluginPair.Metadata.Name}"
|
||||
Grid.Column="0"
|
||||
Cursor="Hand" MouseUp="OnPluginNameClick" FontSize="24"
|
||||
HorizontalAlignment="Left" />
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom" Opacity="0.5">
|
||||
<TextBlock Text="{DynamicResource author}" />
|
||||
<TextBlock Text=": " />
|
||||
<TextBlock Text="{Binding PluginPair.Metadata.Author}" ToolTip="{Binding PluginPair.Metadata.Author}" />
|
||||
</StackPanel>
|
||||
HorizontalAlignment="Left">
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock>
|
||||
<Run Text="{DynamicResource author}" />
|
||||
<Run Text=": " />
|
||||
<Run Text="{Binding PluginPair.Metadata.Author}" />
|
||||
</TextBlock>
|
||||
</ToolTipService.ToolTip>
|
||||
</TextBlock>
|
||||
<ui:ToggleSwitch Grid.Column="1" OffContent="Disabled" OnContent="Enabled"
|
||||
MaxWidth="110" HorizontalAlignment="Right"
|
||||
IsOn="{Binding PluginState}"/>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
|
||||
ToolTip="{Binding PluginPair.Metadata.Description}"
|
||||
Grid.Row="1" Opacity="0.5" />
|
||||
<DockPanel Grid.Row="2" Margin="0 10 0 8">
|
||||
<CheckBox IsChecked="{Binding PluginPair.Metadata.Disabled}" Checked="OnPluginToggled"
|
||||
Unchecked="OnPluginToggled">
|
||||
<TextBlock Text="{DynamicResource disable}" />
|
||||
</CheckBox>
|
||||
<DockPanel Grid.Row="2" Margin="0 10 0 8" HorizontalAlignment="Right">
|
||||
|
||||
<TextBlock Text="{DynamicResource actionKeywords}"
|
||||
Visibility="{Binding ActionKeywordsVisibility}"
|
||||
Margin="20 0 0 0" />
|
||||
Margin="20 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding ActionKeywordsText}"
|
||||
Visibility="{Binding ActionKeywordsVisibility}"
|
||||
ToolTip="Change Action Keywords"
|
||||
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
||||
MouseUp="OnPluginActionKeywordsClick" />
|
||||
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" />
|
||||
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" />
|
||||
MouseUp="OnPluginActionKeywordsClick" MaxWidth="100" />
|
||||
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{DynamicResource pluginDirectory}"
|
||||
HorizontalAlignment="Right" Cursor="Hand"
|
||||
MaxWidth="100" Cursor="Hand" Margin="40 0 0 0"
|
||||
MouseUp="OnPluginDirecotyClick" Foreground="Blue" />
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -270,7 +270,6 @@ namespace Flow.Launcher
|
|||
private void OnClosed(object sender, EventArgs e)
|
||||
{
|
||||
_viewModel.Save();
|
||||
PluginManager.Save();
|
||||
}
|
||||
|
||||
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,14 @@ namespace Flow.Launcher.ViewModel
|
|||
private readonly Internationalization _translator = InternationalizationManager.Instance;
|
||||
|
||||
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 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);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,14 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
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>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"ID": "D2D2C23B084D422DB66FE0C79D6C2A6A",
|
||||
"ActionKeyword": "wpm",
|
||||
"Name": "Flow Launcher Plugin Management",
|
||||
"Name": "Plugin Management",
|
||||
"Description": "Install/Remove/Update Flow Launcher plugins",
|
||||
"Author": "qianlifeng",
|
||||
"Version": "1.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue