From cd143a4ec52069106d0c95f4ac09ba975c8cda00 Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 25 Sep 2023 00:56:36 -0400 Subject: [PATCH 1/4] Add names for image folder panel --- .../Views/Inference/InferenceImageUpscaleView.axaml | 1 + .../Views/Inference/InferenceTextToImageView.axaml | 1 + 2 files changed, 2 insertions(+) diff --git a/StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml b/StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml index cbc81740..c4e460ba 100644 --- a/StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml +++ b/StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml @@ -171,6 +171,7 @@ Proportion="0.1"> diff --git a/StabilityMatrix.Avalonia/Views/Inference/InferenceTextToImageView.axaml b/StabilityMatrix.Avalonia/Views/Inference/InferenceTextToImageView.axaml index 0d0ff25c..407064db 100644 --- a/StabilityMatrix.Avalonia/Views/Inference/InferenceTextToImageView.axaml +++ b/StabilityMatrix.Avalonia/Views/Inference/InferenceTextToImageView.axaml @@ -202,6 +202,7 @@ From d486ee414b27ca76f4b0b737ed510523f5136786 Mon Sep 17 00:00:00 2001 From: Ionite Date: Mon, 25 Sep 2023 01:04:03 -0400 Subject: [PATCH 2/4] Add copy button on ImageViewerDialog --- .../Dialogs/ImageViewerViewModel.cs | 19 +++++++++++++++++++ .../Views/Dialogs/ImageViewerDialog.axaml | 18 +++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/ImageViewerViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/ImageViewerViewModel.cs index 1c6b9e57..b4844144 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/ImageViewerViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/ImageViewerViewModel.cs @@ -1,16 +1,20 @@ using System; +using System.Threading.Tasks; using Avalonia; using Avalonia.Controls.Primitives; +using Avalonia.Media.Imaging; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using FluentAvalonia.Core; using Microsoft.Extensions.DependencyInjection; using StabilityMatrix.Avalonia.Controls; +using StabilityMatrix.Avalonia.Helpers; using StabilityMatrix.Avalonia.Models; using StabilityMatrix.Avalonia.ViewModels.Base; using StabilityMatrix.Avalonia.Views; using StabilityMatrix.Avalonia.Views.Dialogs; using StabilityMatrix.Core.Attributes; +using StabilityMatrix.Core.Helper; using StabilityMatrix.Core.Models.Database; using Size = StabilityMatrix.Core.Helper.Size; @@ -74,6 +78,21 @@ public partial class ImageViewerViewModel : ContentDialogViewModelBase NavigationRequested?.Invoke(this, DirectionalNavigationEventArgs.Down); } + [RelayCommand] + private async Task CopyImage(Bitmap? image) + { + if (image is null || !Compat.IsWindows) + return; + + await Task.Run(() => + { + if (Compat.IsWindows) + { + WindowsClipboard.SetBitmap(image); + } + }); + } + public BetterContentDialog GetDialog() { var margins = new Thickness(64, 32); diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml index 055e3e30..0f0484de 100644 --- a/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml +++ b/StabilityMatrix.Avalonia/Views/Dialogs/ImageViewerDialog.axaml @@ -47,7 +47,23 @@ VerticalAlignment="Stretch" RowDefinitions="*,Auto"> - + + + + + + + Date: Mon, 25 Sep 2023 01:04:11 -0400 Subject: [PATCH 3/4] Remove comment --- .../Controls/AdvancedImageBoxView.axaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/StabilityMatrix.Avalonia/Controls/AdvancedImageBoxView.axaml b/StabilityMatrix.Avalonia/Controls/AdvancedImageBoxView.axaml index c3b8e6e7..d9032f21 100644 --- a/StabilityMatrix.Avalonia/Controls/AdvancedImageBoxView.axaml +++ b/StabilityMatrix.Avalonia/Controls/AdvancedImageBoxView.axaml @@ -17,13 +17,6 @@ Image="{Binding BitmapAsync^}"> - Date: Mon, 25 Sep 2023 01:21:04 -0400 Subject: [PATCH 4/4] Move delete above copy --- StabilityMatrix.Avalonia/Controls/ImageFolderCard.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Controls/ImageFolderCard.axaml b/StabilityMatrix.Avalonia/Controls/ImageFolderCard.axaml index 1bcf4019..50a74bd7 100644 --- a/StabilityMatrix.Avalonia/Controls/ImageFolderCard.axaml +++ b/StabilityMatrix.Avalonia/Controls/ImageFolderCard.axaml @@ -140,11 +140,11 @@