Skip to content

Commit b970fdc

Browse files
committed
- rename LabelUpdate from LabelUpdated
- Changed 'New' logic. - Fix order - Adjust Strings
1 parent f1c2dfe commit b970fdc

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@
9393
<system:String x:Key="updatebtn">Update</system:String>
9494
<system:String x:Key="LabelInstalled">Installed</system:String>
9595
<system:String x:Key="LabelInstalledToolTip">Plug-in already installed</system:String>
96-
<system:String x:Key="LabelNew">New</system:String>
97-
<system:String x:Key="LabelNewToolTip">This is a newly registered plug-in in 7 days</system:String>
98-
<system:String x:Key="LabelUpdated">Updated</system:String>
99-
<system:String x:Key="LabelUpdatedToolTip">This plug-in has been updated within the last 5 days</system:String>
96+
<system:String x:Key="LabelNew">New Version</system:String>
97+
<system:String x:Key="LabelNewToolTip">This plug-in has been updated within the last 7 days</system:String>
98+
<system:String x:Key="LabelUpdate">Update</system:String>
99+
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>
100100

101101

102102

Flow.Launcher/SettingWindow.xaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,19 +1534,19 @@
15341534
Text="{DynamicResource LabelNew}" />
15351535
</Border>
15361536
<Border
1537-
x:Name="LabelUpdated"
1537+
x:Name="LabelUpdate"
15381538
Margin="0,10,8,0"
15391539
Padding="6,2,6,2"
15401540
HorizontalAlignment="Right"
15411541
VerticalAlignment="Top"
15421542
Background="#45BD59"
15431543
CornerRadius="4"
1544-
ToolTip="{DynamicResource LabelUpdatedToolTip}"
1545-
Visibility="{Binding LabelUpdated, Converter={StaticResource BoolToVisibilityConverter}}">
1544+
ToolTip="{DynamicResource LabelUpdateToolTip}"
1545+
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}">
15461546
<TextBlock
15471547
FontSize="11"
15481548
Foreground="{DynamicResource Color01B}"
1549-
Text="{DynamicResource LabelUpdated}" />
1549+
Text="{DynamicResource LabelUpdate}" />
15501550
</Border>
15511551
<Border
15521552
x:Name="Labelinstalled"
@@ -1695,18 +1695,18 @@
16951695
Padding="15,5,15,5"
16961696
HorizontalAlignment="Right"
16971697
VerticalAlignment="Center"
1698-
Click="OnExternalPluginUninstallClick"
1699-
Content="{DynamicResource uninstallbtn}"
1700-
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}" />
1698+
Click="OnExternalPluginInstallClick"
1699+
Content="{DynamicResource installbtn}"
1700+
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" />
17011701
<Button
17021702
MinHeight="40"
17031703
Margin="0,70,20,0"
17041704
Padding="15,5,15,5"
17051705
HorizontalAlignment="Right"
17061706
VerticalAlignment="Center"
1707-
Click="OnExternalPluginInstallClick"
1708-
Content="{DynamicResource installbtn}"
1709-
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" />
1707+
Click="OnExternalPluginUninstallClick"
1708+
Content="{DynamicResource uninstallbtn}"
1709+
Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}}" />
17101710
<Button
17111711
MinHeight="40"
17121712
Margin="0,70,20,0"
@@ -1715,7 +1715,7 @@
17151715
VerticalAlignment="Center"
17161716
Click="OnExternalPluginUpdateClick"
17171717
Content="{DynamicResource updatebtn}"
1718-
Visibility="{Binding UpdateBtn, Converter={StaticResource BoolToVisibilityConverter}}" />
1718+
Visibility="{Binding LabelUpdate, Converter={StaticResource BoolToVisibilityConverter}}" />
17191719
<!-- Hide Install Button when installed Item -->
17201720
</Grid>
17211721
</Grid>

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23
using Flow.Launcher.Core.ExternalPlugins;
34
using Flow.Launcher.Core.Plugin;
45
using Flow.Launcher.Plugin;
@@ -25,9 +26,8 @@ public PluginStoreItemViewModel(UserPlugin plugin)
2526
public string UrlSourceCode => _plugin.UrlSourceCode;
2627
public string IcoPath => _plugin.IcoPath;
2728

28-
public bool LabelNew => _plugin.LatestReleaseDate - DateTime.Now < TimeSpan.FromDays(7);
2929
public bool LabelInstalled => PluginManager.GetPluginForId(_plugin.ID) != null;
30-
public bool LabelUpdated => _plugin.DateAdded - DateTime.Now < TimeSpan.FromDays(5) && !LabelNew;
31-
public bool UpdateBtn => LabelUpdated && LabelInstalled && _plugin.Version != PluginManager.GetPluginForId(_plugin.ID).Metadata.Version;
30+
public bool LabelUpdate => LabelInstalled && _plugin.Version != PluginManager.GetPluginForId(_plugin.ID).Metadata.Version;
31+
public bool LabelNew => DateTime.Now - _plugin.LatestReleaseDate < TimeSpan.FromDays(7) && !LabelUpdate; // Show Update Label show first.
3232
}
3333
}

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ public IList<PluginStoreItemViewModel> ExternalPlugins
294294
private IList<PluginStoreItemViewModel> LabelMaker(IList<UserPlugin> list)
295295
{
296296
return list.Select(p=>new PluginStoreItemViewModel(p))
297-
.OrderBy(p=>p.LabelNew)
298-
.ThenByDescending(p=>p.LabelUpdated)
297+
.OrderByDescending(p=>p.LabelNew)
298+
.ThenByDescending(p=>p.LabelUpdate)
299299
.ThenBy(p=>p.LabelInstalled)
300300
.ToList();
301301
}

0 commit comments

Comments
 (0)