Skip to content

Commit

Permalink
V2021.12.1
Browse files Browse the repository at this point in the history
- Design Tweaks
- Fixed an issue where the old image stayed selected after a re-sync
  • Loading branch information
nlogozzo committed Dec 20, 2021
1 parent ba7b12b commit 8a62e11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Nickvision Spotlight"
#define MyAppVersion "2021.12.0"
#define MyAppVersion "2021.12.1"
#define MyAppPublisher "Nickvision"
#define MyAppURL "https://github.com/nlogozzo/NickvisionSpotlight"
#define MyAppExeName "NickvisionSpotlight.exe"
Expand Down
9 changes: 6 additions & 3 deletions NickvisionSpotlight/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class MainWindowViewModel : ViewModelBase
private string _selectedImage;
private Bitmap _selectedImageSource;

public bool IsImageNotSelected => string.IsNullOrEmpty(SelectedImage);
public ObservableCollection<string> SpotlightImages { get; init; }
public DelegateAsyncCommand<ICloseable> OpenedCommand { get; init; }
public DelegateAsyncCommand<object> SaveCommand { get; init; }
Expand Down Expand Up @@ -76,6 +77,7 @@ public string SelectedImage
set
{
SetProperty(ref _selectedImage, value);
OnPropertyChanged("IsImageNotSelected");
foreach(var image in _spotlightManager.SpotlightImages)
{
if(image.Filename == value)
Expand Down Expand Up @@ -155,6 +157,7 @@ private async Task SaveAll(object parameter)
private async Task SyncSpotlightImages(object parameter)
{
SpotlightImages.Clear();
SelectedImageSource = null;
await _serviceCollection.GetService<IProgressDialogService>().ShowAsync("Syncing spotlight images...", async () => await _spotlightManager.SyncSpotlightImagesAsync());
foreach(var image in _spotlightManager.SpotlightImages)
{
Expand All @@ -168,7 +171,7 @@ private async Task SyncSpotlightImages(object parameter)

private async Task CheckForUpdates(ICloseable window)
{
var updater = new Updater(_httpClient, new Uri("https://raw.githubusercontent.com/nlogozzo/NickvisionSpotlight/main/UpdateConfig.json"), new Version("2021.12.0"));
var updater = new Updater(_httpClient, new Uri("https://raw.githubusercontent.com/nlogozzo/NickvisionSpotlight/main/UpdateConfig.json"), new Version("2021.12.1"));
await _serviceCollection.GetService<IProgressDialogService>().ShowAsync("Checking for updates...", async () => await updater.CheckForUpdatesAsync());
if (updater.UpdateAvailable)
{
Expand Down Expand Up @@ -213,7 +216,7 @@ private async Task Changelog(object parameter)
await _serviceCollection.GetService<IContentDialogService>().ShowMessageAsync(new ContentDialogInfo()
{
Title = "What's New?",
Description = "- Initial Release",
Description = "- Design Tweaks\n- Fixed an issue where the old image stayed selected after a re-sync",
CloseButtonText = "OK",
DefaultButton = ContentDialogButton.Close
});
Expand All @@ -224,7 +227,7 @@ private async Task About(object parameter)
await _serviceCollection.GetService<IContentDialogService>().ShowMessageAsync(new ContentDialogInfo()
{
Title = "About",
Description = "Nickvision Spotlight Version 2021.12.0\nA utility for working with Windows Spotlight images.\n\nUsing Avalonia and .NET 6",
Description = "Nickvision Spotlight Version 2021.12.1\nA utility for working with Windows Spotlight images.\n\nUsing Avalonia and .NET 6",
CloseButtonText = "OK",
DefaultButton = ContentDialogButton.Close
});
Expand Down
6 changes: 5 additions & 1 deletion NickvisionSpotlight/Views/MainWindowView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@
</Border>

<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="350,6,6,6" Background="{DynamicResource SolidBackgroundFillColorBaseBrush}" CornerRadius="6">
<Image Margin="6,6,6,6" Stretch="Uniform" Source="{Binding SelectedImageSource}"/>
<Grid>
<Image HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="6,6,6,6" Stretch="Uniform" Source="{Binding SelectedImageSource}"/>

<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{Binding IsImageNotSelected}" FontSize="16" Text="Please sync then select an image."/>
</Grid>
</Border>
</Grid>
</Border>
Expand Down
2 changes: 1 addition & 1 deletion UpdateConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"LatestVersion":"2021.12.0","Changelog":"- Initial Release","LinkToExeInstaller":"https://github.com/nlogozzo/NickvisionSpotlight/releases/download/2021.12.0/NickvisionSpotlightSetup.exe"}
{"LatestVersion":"2021.12.1","Changelog":"- Design Tweaks\n- Fixed an issue where the old image stayed selected after a re-sync","LinkToExeInstaller":"https://github.com/nlogozzo/NickvisionSpotlight/releases/download/2021.12.0/NickvisionSpotlightSetup.exe"}

0 comments on commit 8a62e11

Please sign in to comment.