From 607b040555ed29cba5d6e27137bfc561145501ac Mon Sep 17 00:00:00 2001 From: Ionite Date: Wed, 7 Jun 2023 19:11:53 -0400 Subject: [PATCH] Update UI layout of CheckpointFile cards --- StabilityMatrix/CheckpointManagerPage.xaml | 227 +++++++++++------- .../MockCheckpointManagerViewModel.cs | 23 +- 2 files changed, 162 insertions(+), 88 deletions(-) diff --git a/StabilityMatrix/CheckpointManagerPage.xaml b/StabilityMatrix/CheckpointManagerPage.xaml index 96d93e12..a507639a 100644 --- a/StabilityMatrix/CheckpointManagerPage.xaml +++ b/StabilityMatrix/CheckpointManagerPage.xaml @@ -4,7 +4,7 @@ Loaded="CheckpointManagerPage_OnLoaded" d:DataContext="{d:DesignInstance Type=designData:MockCheckpointManagerViewModel, IsDesignTimeCreatable=True}" - d:DesignHeight="500" + d:DesignHeight="1000" d:DesignWidth="650" mc:Ignorable="d" x:Class="StabilityMatrix.CheckpointManagerPage" @@ -20,6 +20,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + + + + @@ -34,14 +38,16 @@ x:Key="TextDropShadowEffect" /> - + + Margin="8,8,8,8" + MaxHeight="512" + MaxWidth="300" + MinWidth="240" + Padding="12,16"> @@ -50,76 +56,116 @@ - - - - - - - - - - - - - - + Foreground="{DynamicResource TextFillColorTertiaryBrush}" + Text="{Binding ConnectedModel.VersionName, FallbackValue=''}" + TextWrapping="WrapWithOverflow" + Visibility="{Binding IsConnectedModel, Converter={StaticResource BoolToVisibilityConverter}}" /> + + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/StabilityMatrix/DesignData/MockCheckpointManagerViewModel.cs b/StabilityMatrix/DesignData/MockCheckpointManagerViewModel.cs index f1867f51..f6de801d 100644 --- a/StabilityMatrix/DesignData/MockCheckpointManagerViewModel.cs +++ b/StabilityMatrix/DesignData/MockCheckpointManagerViewModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using StabilityMatrix.Models.Api; using StabilityMatrix.ViewModels; namespace StabilityMatrix.DesignData; @@ -27,19 +28,35 @@ public class MockCheckpointManagerViewModel : CheckpointManagerViewModel }, new() { - Title = "Example Realistic", - FilePath = "exr-v21.safetensors", + Title = "Some Model", + FilePath = "exr-v3.safetensors", ConnectedModel = new() { ModelName = "Example Realistic", - VersionName = "Hybrid v41", + VersionName = "v3.0-Inpainting", ModelDescription = "Example Description", + BaseModel = "SD 1.5", + FileMetadata = new() + { + Fp = CivitModelFpType.fp32, + } } }, new() { Title = "Painting e12", FilePath = "painting-e12.pt", + ConnectedModel = new() + { + ModelName = "Long Name Model (Stuff)", + VersionName = "v42-Advanced-Hybrid", + ModelDescription = "Example Description", + BaseModel = "SD 2.0", + FileMetadata = new() + { + Fp = CivitModelFpType.fp16, + } + } }, } },