From 1ff80890d548652bb3578b6e30cb669cfab0863b Mon Sep 17 00:00:00 2001 From: Ano-sys Date: Fri, 3 Apr 2026 00:44:55 +0200 Subject: [PATCH] Upgraded UI drastically --- Photos/Animations/CardHoverEffectBehavior.cs | 2 +- Photos/ViewModels/MainWindowViewModel.cs | 8 + Photos/Views/MainWindow.axaml | 275 ++++++++++++++----- 3 files changed, 209 insertions(+), 76 deletions(-) diff --git a/Photos/Animations/CardHoverEffectBehavior.cs b/Photos/Animations/CardHoverEffectBehavior.cs index 6349461..8519212 100644 --- a/Photos/Animations/CardHoverEffectBehavior.cs +++ b/Photos/Animations/CardHoverEffectBehavior.cs @@ -67,7 +67,7 @@ public static class CardHoverEffectBehavior if (sender is not Control element) return; - element.ZIndex = 1; + element.ZIndex = 10; var visual = ElementComposition.GetElementVisual(element); var compositor = visual?.Compositor; diff --git a/Photos/ViewModels/MainWindowViewModel.cs b/Photos/ViewModels/MainWindowViewModel.cs index e0b1d11..f3f20ca 100644 --- a/Photos/ViewModels/MainWindowViewModel.cs +++ b/Photos/ViewModels/MainWindowViewModel.cs @@ -22,6 +22,7 @@ public partial class MainWindowViewModel : ViewModelBase [ObservableProperty] private ObservableCollection _photos = []; [ObservableProperty] private Photo? _selectedPhoto; + [ObservableProperty] private bool _photosLoaded = false; public string LibraryPath { get; private set; } = string.Empty; @@ -40,6 +41,13 @@ public partial class MainWindowViewModel : ViewModelBase LibraryPath = folder; await AddPhotosAsync(folder); + PhotosLoaded = true; + } + + public void CloseDirectory() + { + Photos.Clear(); + PhotosLoaded = false; } private void SanitizeFiles(List files, IEnumerable extensions) diff --git a/Photos/Views/MainWindow.axaml b/Photos/Views/MainWindow.axaml index 79f2935..001d450 100644 --- a/Photos/Views/MainWindow.axaml +++ b/Photos/Views/MainWindow.axaml @@ -7,7 +7,9 @@ xmlns:ic="using:Avalonia.Xaml.Interactions.Core" xmlns:models="using:Photos.Models" xmlns:anim="using:Photos.Animations" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + mc:Ignorable="d" + d:DesignWidth="1200" + d:DesignHeight="800" x:Class="Photos.Views.MainWindow" x:DataType="vm:MainWindowViewModel" x:Name="Root" @@ -18,86 +20,209 @@ ExtendClientAreaChromeHints="NoChrome" TransparencyLevelHint="AcrylicBlur" Background="Transparent" - ExtendClientAreaToDecorationsHint="True" - > + ExtendClientAreaToDecorationsHint="True"> - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + +