- rename LabelUpdate from LabelUpdated

- Changed 'New' logic.
- Fix order
- Adjust Strings
This commit is contained in:
DB p 2022-10-12 00:08:13 +09:00
parent f1c2dfec12
commit b970fdc7f0
4 changed files with 23 additions and 23 deletions

View file

@ -93,10 +93,10 @@
<system:String x:Key="updatebtn">Update</system:String>
<system:String x:Key="LabelInstalled">Installed</system:String>
<system:String x:Key="LabelInstalledToolTip">Plug-in already installed</system:String>
<system:String x:Key="LabelNew">New</system:String>
<system:String x:Key="LabelNewToolTip">This is a newly registered plug-in in 7 days</system:String>
<system:String x:Key="LabelUpdated">Updated</system:String>
<system:String x:Key="LabelUpdatedToolTip">This plug-in has been updated within the last 5 days</system:String>
<system:String x:Key="LabelNew">New Version</system:String>
<system:String x:Key="LabelNewToolTip">This plug-in has been updated within the last 7 days</system:String>
<system:String x:Key="LabelUpdate">Update</system:String>
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>

View file

@ -1534,19 +1534,19 @@
Text="{DynamicResource LabelNew}" />
</Border>
<Border
x:Name="LabelUpdated"
x:Name="LabelUpdate"
Margin="0,10,8,0"
Padding="6,2,6,2"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="#45BD59"
CornerRadius="4"
ToolTip="{DynamicResource LabelUpdatedToolTip}"
Visibility="{Binding LabelUpdated, Converter={StaticResource BoolToVisibilityConverter}}">
ToolTip="{DynamicResource LabelUpdateToolTip}"
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}">
<TextBlock
FontSize="11"
Foreground="{DynamicResource Color01B}"
Text="{DynamicResource LabelUpdated}" />
Text="{DynamicResource LabelUpdate}" />
</Border>
<Border
x:Name="Labelinstalled"
@ -1689,15 +1689,6 @@
</StackPanel>
</StackPanel>
<Grid Grid.Row="0" Grid.Column="1">
<Button
MinHeight="40"
Margin="0,70,20,0"
Padding="15,5,15,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="OnExternalPluginUninstallClick"
Content="{DynamicResource uninstallbtn}"
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}" />
<Button
MinHeight="40"
Margin="0,70,20,0"
@ -1707,6 +1698,15 @@
Click="OnExternalPluginInstallClick"
Content="{DynamicResource installbtn}"
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" />
<Button
MinHeight="40"
Margin="0,70,20,0"
Padding="15,5,15,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="OnExternalPluginUninstallClick"
Content="{DynamicResource uninstallbtn}"
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}" />
<Button
MinHeight="40"
Margin="0,70,20,0"
@ -1715,7 +1715,7 @@
VerticalAlignment="Center"
Click="OnExternalPluginUpdateClick"
Content="{DynamicResource updatebtn}"
Visibility="{Binding UpdateBtn, Converter={StaticResource BoolToVisibilityConverter}}" />
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
<!-- Hide Install Button when installed Item -->
</Grid>
</Grid>

View file

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using Flow.Launcher.Core.ExternalPlugins;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Plugin;
@ -25,9 +26,8 @@ namespace Flow.Launcher.ViewModel
public string UrlSourceCode => _plugin.UrlSourceCode;
public string IcoPath => _plugin.IcoPath;
public bool LabelNew => _plugin.LatestReleaseDate - DateTime.Now < TimeSpan.FromDays(7);
public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null;
public bool LabelUpdated => _plugin.DateAdded - DateTime.Now < TimeSpan.FromDays(5) && !LabelNew;
public bool UpdateBtn => LabelUpdated && LabelInstalled && _plugin.Version != PluginManager.GetPluginForId(_plugin.ID).Metadata.Version;
public bool LabelUpdate => LabelInstalled && _plugin.Version != PluginManager.GetPluginForId(_plugin.ID).Metadata.Version;
public bool LabelNew => DateTime.Now - _plugin.LatestReleaseDate < TimeSpan.FromDays(7) && !LabelUpdate; // Show Update Label show first.
}
}

View file

@ -294,8 +294,8 @@ namespace Flow.Launcher.ViewModel
private IList<PluginStoreItemViewModel> LabelMaker(IList<UserPlugin> list)
{
return list.Select(p=>new PluginStoreItemViewModel(p))
.OrderBy(p=>p.LabelNew)
.ThenByDescending(p=>p.LabelUpdated)
.OrderByDescending(p=>p.LabelNew)
.ThenByDescending(p=>p.LabelUpdate)
.ThenBy(p=>p.LabelInstalled)
.ToList();
}