Added acrylic blur test

This commit is contained in:
Robert committed 2023-07-23 17:19:56 +02:00
1 parent 0e077e31b3
commit e03d6b20e9
10 files changed
+353 -92

No files matched your search

@@ -5,31 +5,40 @@
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:entries="clr-namespace:Artemis.UI.Screens.Workshop.Profile"
xmlns:entries1="clr-namespace:Artemis.UI.Screens.Workshop.Entries"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="120"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="110"
x:Class="Artemis.UI.Screens.Workshop.Entries.EntryListView"
x:DataType="entries1:EntryListViewModel">
<Border Classes="card" MinHeight="120">
<Button MinHeight="110"
MaxHeight="140"
Padding="16"
CornerRadius="8"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Command="{CompiledBinding NavigateToEntry}">
<Grid ColumnDefinitions="Auto,*,Auto">
<!-- Icon -->
<Border Grid.Column="0"
Cursor="Hand"
CornerRadius="12"
Background="{StaticResource ControlStrokeColorOnAccentDefault}"
VerticalAlignment="Center"
Margin="0 0 10 0"
Width="90"
Height="90"
PointerReleased="InputElement_OnPointerReleased">
<avalonia:MaterialIcon Kind="HandOkay" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="80" Height="80"/>
Width="80"
Height="80">
<avalonia:MaterialIcon Kind="HandOkay" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="70" Height="70" />
</Border>
<!-- Body -->
<Grid Grid.Column="1" VerticalAlignment="Stretch" RowDefinitions="Auto,*,Auto">
<TextBlock Grid.Row="0" Margin="0 0 0 5" Cursor="Hand" PointerReleased="InputElement_OnPointerReleased">
<Run Classes="h4" Text="{CompiledBinding Entry.Name, FallbackValue=Title}" />
<TextBlock Grid.Row="0" Margin="0 0 0 5" TextTrimming="CharacterEllipsis" >
<Run Classes="h5" Text="{CompiledBinding Entry.Name, FallbackValue=Title}" />
<Run Classes="subtitle">by</Run>
<Run Classes="subtitle" Text="{CompiledBinding Entry.Author, FallbackValue=Author}" />
</TextBlock>
<TextBlock Grid.Row="1" FontSize="15" Classes="subtitle" Text="{CompiledBinding Entry.Summary, FallbackValue=Summary}"></TextBlock>
<TextBlock Grid.Row="1"
Classes="subtitle"
TextWrapping="Wrap"
TextTrimming="CharacterEllipsis"
Text="{CompiledBinding Entry.Summary, FallbackValue=Summary}"></TextBlock>
<ItemsControl Grid.Row="2" ItemsSource="{CompiledBinding Entry.Categories}">
<ItemsControl.ItemsPanel>
@@ -41,12 +50,14 @@
<DataTemplate>
<StackPanel Orientation="Horizontal">
<avalonia:MaterialIcon Kind="{CompiledBinding Icon}" Margin="0 0 3 0"></avalonia:MaterialIcon>
<TextBlock Text="{CompiledBinding Name}" />
<TextBlock Text="{CompiledBinding Name}" TextTrimming="CharacterEllipsis" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<!-- Info -->
<StackPanel Grid.Column="2">
<TextBlock TextAlignment="Right" Text="{CompiledBinding Entry.CreatedAt, StringFormat={}{0:g}, FallbackValue=01-01-1337}" />
<TextBlock TextAlignment="Right">
@@ -54,8 +65,7 @@
<Run Classes="h5" Text="{CompiledBinding Entry.Downloads, FallbackValue=0}" />
<Run>downloads</Run>
</TextBlock>
</StackPanel>
</Grid>
</Border>
</Button>
</UserControl>
@@ -16,9 +16,4 @@ public partial class EntryListView : ReactiveUserControl<EntryListViewModel>
{
AvaloniaXamlLoader.Load(this);
}
private async void InputElement_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
await ViewModel.NavigateToEntry();
}
}
@@ -1,8 +1,10 @@
using System;
using System.Reactive;
using System.Threading.Tasks;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Routing;
using Artemis.WebClient.Workshop;
using ReactiveUI;
namespace Artemis.UI.Screens.Workshop.Entries;
@@ -14,11 +16,13 @@ public class EntryListViewModel : ViewModelBase
{
_router = router;
Entry = entry;
NavigateToEntry = ReactiveCommand.CreateFromTask(ExecuteNavigateToEntry);
}
public IGetEntries_Entries_Items Entry { get; }
public ReactiveCommand<Unit,Unit> NavigateToEntry { get; }
public async Task NavigateToEntry()
private async Task ExecuteNavigateToEntry()
{
switch (Entry.EntryType)
{