You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
200 lines
12 KiB
200 lines
12 KiB
1 year ago
|
<Styles
|
||
|
xmlns="https://github.com/avaloniaui"
|
||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
|
||
|
xmlns:inference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
|
||
|
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
|
||
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
||
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
|
||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||
|
x:DataType="inference:ModelCardViewModel">
|
||
1 year ago
|
<Design.PreviewWith>
|
||
1 year ago
|
<Panel Width="400" Height="200">
|
||
1 year ago
|
<StackPanel Width="300" VerticalAlignment="Center">
|
||
|
<controls:ModelCard DataContext="{x:Static mocks:DesignData.ModelCardViewModel}" />
|
||
1 year ago
|
</StackPanel>
|
||
|
</Panel>
|
||
1 year ago
|
</Design.PreviewWith>
|
||
|
|
||
|
<Style Selector="controls|ModelCard">
|
||
1 year ago
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||
1 year ago
|
<Setter Property="Template">
|
||
|
<ControlTemplate>
|
||
1 year ago
|
<controls:Card Padding="12">
|
||
1 year ago
|
<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="*,*,*">
|
||
|
<!-- Model -->
|
||
1 year ago
|
<TextBlock
|
||
|
Grid.Column="0"
|
||
1 year ago
|
MinWidth="60"
|
||
1 year ago
|
VerticalAlignment="Center"
|
||
|
Text="{x:Static lang:Resources.Label_Model}"
|
||
|
TextAlignment="Left" />
|
||
1 year ago
|
<ui:FAComboBox
|
||
1 year ago
|
Grid.Row="0"
|
||
1 year ago
|
Grid.Column="1"
|
||
1 year ago
|
Theme="{StaticResource FAComboBoxHybridModelTheme}"
|
||
1 year ago
|
HorizontalAlignment="Stretch"
|
||
1 year ago
|
ItemsSource="{Binding ClientManager.Models}"
|
||
|
SelectedItem="{Binding SelectedModel}">
|
||
1 year ago
|
<!--<ui:FAComboBox.Styles>
|
||
1 year ago
|
<Style Selector="ui|FAComboBoxItem">
|
||
|
<Setter Property="ToolTip.Placement" Value="RightEdgeAlignedTop" />
|
||
|
<Setter Property="ToolTip.Tip">
|
||
|
<Template>
|
||
|
<StackPanel
|
||
|
x:DataType="models:HybridModelFile"
|
||
|
Orientation="Horizontal"
|
||
|
Spacing="6">
|
||
1 year ago
|
~1~ Image @1@
|
||
1 year ago
|
<controls:BetterAdvancedImage
|
||
|
Width="64"
|
||
|
Height="96"
|
||
|
CornerRadius="6"
|
||
|
IsVisible="{Binding Local.PreviewImageFullPathGlobal, Converter={x:Static StringConverters.IsNotNullOrEmpty}, FallbackValue=''}"
|
||
|
RenderOptions.BitmapInterpolationMode="HighQuality"
|
||
|
Source="{Binding Local.PreviewImageFullPathGlobal, FallbackValue=''}"
|
||
|
Stretch="UniformToFill"
|
||
|
StretchDirection="Both" />
|
||
|
<Grid RowDefinitions="Auto,Auto,*" VerticalAlignment="Stretch" MaxWidth="300">
|
||
1 year ago
|
~1~ Title @1@
|
||
1 year ago
|
<TextBlock
|
||
|
Margin="0,0,0,4"
|
||
|
HorizontalAlignment="Left"
|
||
|
FontSize="14"
|
||
|
FontWeight="Medium"
|
||
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||
|
IsVisible="{Binding Local.ConnectedModelInfo, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
||
|
Text="{Binding Local.ConnectedModelInfo.ModelName, FallbackValue=''}"
|
||
|
TextWrapping="WrapWithOverflow" />
|
||
1 year ago
|
~1~ Version @1@
|
||
1 year ago
|
<TextBlock
|
||
|
Grid.Row="1"
|
||
|
Margin="0,0,0,8"
|
||
|
HorizontalAlignment="Left"
|
||
|
FontSize="13"
|
||
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||
|
IsVisible="{Binding Local.ConnectedModelInfo, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
||
|
Text="{Binding Local.ConnectedModelInfo.VersionName, FallbackValue=''}"
|
||
|
TextWrapping="WrapWithOverflow" />
|
||
1 year ago
|
~1~ Path @1@
|
||
1 year ago
|
<TextBlock
|
||
|
Grid.Row="2"
|
||
|
HorizontalAlignment="Left"
|
||
|
FontSize="13"
|
||
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||
1 year ago
|
Text="{Binding RelativePath}"
|
||
1 year ago
|
TextWrapping="Wrap" />
|
||
|
</Grid>
|
||
|
</StackPanel>
|
||
|
</Template>
|
||
|
</Setter>
|
||
|
</Style>
|
||
|
<Style Selector="ui|FAComboBox /template/ ContentControl#ContentPresenter > StackPanel > TextBlock:nth-child(2)">
|
||
|
<Setter Property="IsVisible" Value="False" />
|
||
|
</Style>
|
||
|
</ui:FAComboBox.Styles>
|
||
|
<ui:FAComboBox.ItemTemplate>
|
||
|
<DataTemplate DataType="models:HybridModelFile">
|
||
|
<StackPanel ToolTip.Placement="RightEdgeAlignedTop">
|
||
|
<TextBlock Text="{Binding ShortDisplayName}" TextTrimming="CharacterEllipsis" />
|
||
|
</StackPanel>
|
||
|
</DataTemplate>
|
||
1 year ago
|
</ui:FAComboBox.ItemTemplate>-->
|
||
1 year ago
|
<!--<ui:FAComboBox.ItemTemplate>
|
||
|
<DataTemplate DataType="models:HybridModelFile">
|
||
|
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="Auto,*">
|
||
|
<controls:BetterAdvancedImage
|
||
|
Grid.Row="0"
|
||
|
Grid.Column="0"
|
||
|
Grid.RowSpan="2"
|
||
|
Margin="0,0,8,0"
|
||
|
Height="32"
|
||
|
Width="32"
|
||
|
Stretch="UniformToFill"
|
||
|
StretchDirection="Both"
|
||
|
RenderOptions.BitmapInterpolationMode="HighQuality"
|
||
|
Source="{Binding Local.PreviewImageFullPathGlobal}">
|
||
|
<controls:BetterAdvancedImage.Clip>
|
||
|
<EllipseGeometry Rect="0,0,32,32" />
|
||
|
</controls:BetterAdvancedImage.Clip>
|
||
|
</controls:BetterAdvancedImage>
|
||
|
<TextBlock
|
||
|
Grid.Row="0"
|
||
|
Grid.Column="1"
|
||
|
Text="{Binding Local.ConnectedModelInfo.VersionName}"/>
|
||
|
<TextBlock
|
||
|
FontSize="11"
|
||
|
Grid.Row="1"
|
||
|
Grid.Column="1"
|
||
|
Text="{Binding Local.ConnectedModelInfo.ModelName}"/>
|
||
|
</Grid>
|
||
|
</DataTemplate>
|
||
|
</ui:FAComboBox.ItemTemplate>-->
|
||
|
</ui:FAComboBox>
|
||
|
|
||
1 year ago
|
<Button
|
||
|
Grid.Row="0"
|
||
1 year ago
|
Grid.Column="2"
|
||
1 year ago
|
Margin="8,0,0,0">
|
||
|
<ui:SymbolIcon FontSize="16" Symbol="Setting" />
|
||
1 year ago
|
<Button.Flyout>
|
||
|
<ui:FAMenuFlyout Placement="BottomEdgeAlignedLeft">
|
||
1 year ago
|
<ui:ToggleMenuFlyoutItem IsChecked="{Binding IsRefinerSelectionEnabled}" Text="{x:Static lang:Resources.Label_Refiner}" />
|
||
|
<ui:ToggleMenuFlyoutItem IsChecked="{Binding IsVaeSelectionEnabled}" Text="{x:Static lang:Resources.Label_VAE}" />
|
||
1 year ago
|
</ui:FAMenuFlyout>
|
||
|
</Button.Flyout>
|
||
1 year ago
|
</Button>
|
||
1 year ago
|
|
||
|
<!-- Refiner -->
|
||
1 year ago
|
<TextBlock
|
||
|
Grid.Row="1"
|
||
1 year ago
|
Grid.Column="0"
|
||
1 year ago
|
MinWidth="60"
|
||
|
Margin="0,8,0,0"
|
||
|
VerticalAlignment="Center"
|
||
1 year ago
|
IsVisible="{Binding IsRefinerSelectionEnabled}"
|
||
|
Text="{x:Static lang:Resources.Label_Refiner}"
|
||
|
TextAlignment="Left" />
|
||
|
|
||
1 year ago
|
<ui:FAComboBox
|
||
|
Grid.Row="1"
|
||
|
Grid.Column="1"
|
||
|
Grid.ColumnSpan="2"
|
||
|
Margin="0,8,0,0"
|
||
1 year ago
|
HorizontalAlignment="Stretch"
|
||
|
DisplayMemberBinding="{Binding ShortDisplayName}"
|
||
1 year ago
|
IsTextSearchEnabled="True"
|
||
1 year ago
|
IsVisible="{Binding IsRefinerSelectionEnabled}"
|
||
|
ItemsSource="{Binding ClientManager.Models}"
|
||
|
SelectedItem="{Binding SelectedRefiner}" />
|
||
1 year ago
|
|
||
|
<!-- VAE -->
|
||
1 year ago
|
<TextBlock
|
||
|
Grid.Row="2"
|
||
1 year ago
|
Grid.Column="0"
|
||
1 year ago
|
MinWidth="60"
|
||
|
Margin="0,8,0,0"
|
||
|
VerticalAlignment="Center"
|
||
1 year ago
|
IsVisible="{Binding IsVaeSelectionEnabled}"
|
||
|
Text="{x:Static lang:Resources.Label_VAE}"
|
||
|
TextAlignment="Left" />
|
||
|
|
||
1 year ago
|
<ui:FAComboBox
|
||
|
Grid.Row="2"
|
||
|
Grid.Column="1"
|
||
|
Grid.ColumnSpan="2"
|
||
|
Margin="0,8,0,0"
|
||
1 year ago
|
HorizontalAlignment="Stretch"
|
||
|
DisplayMemberBinding="{Binding ShortDisplayName}"
|
||
1 year ago
|
IsTextSearchEnabled="True"
|
||
1 year ago
|
IsVisible="{Binding IsVaeSelectionEnabled}"
|
||
1 year ago
|
ItemsSource="{Binding ClientManager.VaeModels}"
|
||
|
SelectedItem="{Binding SelectedVae}" />
|
||
1 year ago
|
|
||
1 year ago
|
</Grid>
|
||
|
</controls:Card>
|
||
|
</ControlTemplate>
|
||
|
</Setter>
|
||
|
</Style>
|
||
|
</Styles>
|