mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Meta - Update packages
This commit is contained in:
1 parent
d2afc77bb8
commit
907c758b83
37 files changed
+382
-205
No files matched your search
@@ -43,7 +43,7 @@
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Text="{CompiledBinding Name}" Margin="0 4 0 0"></TextBlock>
|
||||
<TextBlock Grid.Column="1" Grid.Row="1" Text="{CompiledBinding Email}"></TextBlock>
|
||||
|
||||
<controls:HyperlinkButton
|
||||
<HyperlinkButton
|
||||
IsVisible="{CompiledBinding AllowLogout}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
@@ -51,8 +51,8 @@
|
||||
Padding="6 4"
|
||||
Click="Manage_OnClick">
|
||||
Manage account
|
||||
</controls:HyperlinkButton>
|
||||
<controls:HyperlinkButton
|
||||
</HyperlinkButton>
|
||||
<HyperlinkButton
|
||||
IsVisible="{CompiledBinding AllowLogout}"
|
||||
Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
@@ -60,7 +60,7 @@
|
||||
Padding="6 4"
|
||||
Click="Signout_OnClick">
|
||||
Sign out
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
</Grid>
|
||||
</Flyout>
|
||||
</Ellipse.ContextFlyout>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:il="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:list="clr-namespace:Artemis.UI.Screens.Workshop.Entries.List"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Artemis.UI.Screens.Workshop.Entries.List.EntryListItemVerticalView"
|
||||
x:DataType="list:EntryListItemViewModel">
|
||||
<UserControl.Styles>
|
||||
<StyleInclude Source="/Screens/Workshop/Search/SearchViewStyles.axaml" />
|
||||
</UserControl.Styles>
|
||||
<UserControl.Resources>
|
||||
<converters:EntryIconUriConverter x:Key="EntryIconUriConverter" />
|
||||
</UserControl.Resources>
|
||||
<Button Command="{CompiledBinding NavigateToEntry}" Padding="12">
|
||||
<Grid RowDefinitions="Auto,43,Auto,Auto,*" ColumnDefinitions="Auto,*" Width="150" Height="200">
|
||||
<Border Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
CornerRadius="6"
|
||||
Width="60"
|
||||
Height="60"
|
||||
Margin="0 5"
|
||||
ClipToBounds="True"
|
||||
HorizontalAlignment="Left">
|
||||
<Image Stretch="UniformToFill" il:ImageLoader.Source="{CompiledBinding Entry.Id, Converter={StaticResource EntryIconUriConverter}, Mode=OneWay}" />
|
||||
</Border>
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
MaxLines="2"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
FontSize="16"
|
||||
VerticalAlignment="Center"
|
||||
Text="{CompiledBinding Entry.Name, FallbackValue=Title that is super long and should be wrapped}" />
|
||||
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0 1">
|
||||
<TextBlock Classes="subtitle" MaxLines="1" TextTrimming="CharacterEllipsis" Text="{CompiledBinding Entry.Author, FallbackValue=Author}"/>
|
||||
<avalonia:MaterialIcon IsVisible="{CompiledBinding Entry.IsOfficial}"
|
||||
Kind="ShieldStar"
|
||||
Foreground="{DynamicResource SystemAccentColorLight1}"
|
||||
Margin="2 0 0 0"
|
||||
Width="18"
|
||||
Height="18"
|
||||
HorizontalAlignment="Left"
|
||||
ToolTip.Tip="Official entry by the Artemis team" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
MaxLines="2"
|
||||
TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis"
|
||||
FontSize="12"
|
||||
Opacity="0.8"
|
||||
Text="{CompiledBinding Entry.Summary, FallbackValue=Summary that is super long and should be wrapped}" />
|
||||
|
||||
<Border Grid.Row="4" Grid.Column="0" Classes="badge" VerticalAlignment="Bottom" HorizontalAlignment="Left">
|
||||
<TextBlock>
|
||||
<Run Text="{CompiledBinding Entry.Downloads, FallbackValue=0}" />
|
||||
<Run>downloads</Run>
|
||||
</TextBlock>
|
||||
</Border>
|
||||
<Border Grid.Row="4" Grid.Column="1" Classes="badge" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
||||
<TextBlock Text="{CompiledBinding Entry.EntryType, FallbackValue=Type}"></TextBlock>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,14 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.Entries.List;
|
||||
|
||||
public partial class EntryListItemVerticalView : ReactiveUserControl<EntryListItemVerticalViewModel>
|
||||
{
|
||||
public EntryListItemVerticalView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Artemis.UI.Shared.Routing;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using Artemis.WebClient.Workshop.Services;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.Entries.List;
|
||||
|
||||
public class EntryListItemVerticalViewModel : EntryListItemViewModel
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public EntryListItemVerticalViewModel(IEntrySummary entry, IRouter router, IWorkshopService workshopService) : base(entry, router, workshopService)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
<Border Classes="router-container">
|
||||
<Grid RowDefinitions="200,*,*">
|
||||
<ProgressBar ZIndex="999" IsIndeterminate="True" IsVisible="{CompiledBinding !WorkshopReachable}" Grid.Row="0" VerticalAlignment="Top"></ProgressBar>
|
||||
|
||||
|
||||
<Image Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
VerticalAlignment="Top"
|
||||
@@ -38,7 +38,7 @@
|
||||
<DropShadowEffect Color="Black" OffsetX="2" OffsetY="2" BlurRadius="5"></DropShadowEffect>
|
||||
</TextBlock.Effect>
|
||||
</TextBlock>
|
||||
|
||||
|
||||
<StackPanel Margin="30 -75 30 0" Grid.Row="1">
|
||||
<StackPanel Spacing="10" Orientation="Horizontal" VerticalAlignment="Top">
|
||||
<Button Width="150" Height="180" Command="{CompiledBinding Navigate}" CommandParameter="workshop/entries/profiles" VerticalContentAlignment="Top">
|
||||
@@ -56,7 +56,7 @@
|
||||
<TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.8">Layouts make your devices look great in the editor.</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
|
||||
<Button Width="150" Height="180" Command="{CompiledBinding Navigate}" CommandParameter="workshop/entries/plugins" VerticalContentAlignment="Top">
|
||||
<StackPanel>
|
||||
<avalonia:MaterialIcon Kind="Connection" HorizontalAlignment="Left" Width="60" Height="60" Margin="0 5" />
|
||||
@@ -64,7 +64,7 @@
|
||||
<TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.8">Plugins add new functionality to Artemis.</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
|
||||
<Button Width="150" Height="180" Command="{CompiledBinding Navigate}" CommandParameter="workshop/library" VerticalContentAlignment="Top">
|
||||
<StackPanel>
|
||||
<avalonia:MaterialIcon Kind="Bookshelf" HorizontalAlignment="Left" Width="60" Height="60" Margin="0 5" />
|
||||
@@ -72,7 +72,7 @@
|
||||
<TextBlock TextWrapping="Wrap" FontSize="12" Opacity="0.8">Manage your submissions and downloaded content.</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
|
||||
<Button Width="150" Height="180" Command="{CompiledBinding AddSubmission}" VerticalContentAlignment="Top">
|
||||
<StackPanel>
|
||||
<avalonia:MaterialIcon Kind="CloudUpload" HorizontalAlignment="Left" Width="60" Height="60" Margin="0 5" />
|
||||
@@ -85,10 +85,26 @@
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Classes="h4" Margin="0 15 0 5">Featured submissions</TextBlock>
|
||||
<TextBlock>Not yet implemented, here we'll show submissions we think are worth some extra attention.</TextBlock>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Padding="0 0 0 20">
|
||||
<ItemsControl ItemsSource="{CompiledBinding PopularEntries}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<TextBlock Classes="h4" Margin="0 15 0 5">Recently updated</TextBlock>
|
||||
<TextBlock>Not yet implemented, here we'll a few of the most recent uploads/updates to the workshop.</TextBlock>
|
||||
<TextBlock Classes="h4" Margin="0 15 0 5">Recently added</TextBlock>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" Padding="0 0 0 20">
|
||||
<ItemsControl ItemsSource="{CompiledBinding LatestEntries}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -1,33 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.UI.Extensions;
|
||||
using Artemis.UI.Screens.Workshop.Entries.List;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard;
|
||||
using Artemis.UI.Shared.Routing;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using Artemis.WebClient.Workshop.Services;
|
||||
using DynamicData;
|
||||
using PropertyChanged.SourceGenerator;
|
||||
using ReactiveUI;
|
||||
using StrawberryShake;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.Home;
|
||||
|
||||
public partial class WorkshopHomeViewModel : RoutableScreen
|
||||
{
|
||||
private readonly IWindowService _windowService;
|
||||
|
||||
[Notify(Setter.Private)] private bool _workshopReachable;
|
||||
|
||||
public WorkshopHomeViewModel(IRouter router, IWindowService windowService, IWorkshopService workshopService)
|
||||
public WorkshopHomeViewModel(IRouter router, IWindowService windowService, IWorkshopService workshopService, IWorkshopClient client,
|
||||
Func<IEntrySummary, EntryListItemVerticalViewModel> getEntryListItemViewModel)
|
||||
{
|
||||
_windowService = windowService;
|
||||
SourceList<IEntrySummary> latest = new();
|
||||
SourceList<IEntrySummary> popular = new();
|
||||
|
||||
latest.Connect().Transform(getEntryListItemViewModel).Bind(out ReadOnlyObservableCollection<EntryListItemVerticalViewModel> latestEntries).Subscribe();
|
||||
popular.Connect().Transform(getEntryListItemViewModel).Bind(out ReadOnlyObservableCollection<EntryListItemVerticalViewModel> popularEntries).Subscribe();
|
||||
|
||||
AddSubmission = ReactiveCommand.CreateFromTask(ExecuteAddSubmission, this.WhenAnyValue(vm => vm.WorkshopReachable));
|
||||
Navigate = ReactiveCommand.CreateFromTask<string>(async r => await router.Navigate(r), this.WhenAnyValue(vm => vm.WorkshopReachable));
|
||||
PopularEntries = popularEntries;
|
||||
LatestEntries = latestEntries;
|
||||
|
||||
this.WhenActivatedAsync(async d => WorkshopReachable = await workshopService.ValidateWorkshopStatus(d.AsCancellationToken()));
|
||||
this.WhenActivatedAsync(async d =>
|
||||
{
|
||||
WorkshopReachable = await workshopService.ValidateWorkshopStatus(d.AsCancellationToken());
|
||||
|
||||
IOperationResult<IGetPopularEntriesResult> popularResult = await client.GetPopularEntries.ExecuteAsync();
|
||||
popular.Edit(p =>
|
||||
{
|
||||
p.Clear();
|
||||
if (popularResult.Data?.PopularEntries != null)
|
||||
p.AddRange(popularResult.Data.PopularEntries);
|
||||
});
|
||||
|
||||
IOperationResult<IGetEntriesv2Result> latestResult = await client.GetEntriesv2.ExecuteAsync(null, null, [new EntrySortInput {CreatedAt = SortEnumType.Desc}], 25, null);
|
||||
latest.Edit(l =>
|
||||
{
|
||||
l.Clear();
|
||||
if (latestResult.Data?.EntriesV2?.Edges != null)
|
||||
l.AddRange(latestResult.Data.EntriesV2.Edges.Select(e => e.Node));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public ReactiveCommand<Unit, Unit> AddSubmission { get; }
|
||||
public ReactiveCommand<string, Unit> Navigate { get; }
|
||||
public ReadOnlyObservableCollection<EntryListItemVerticalViewModel> PopularEntries { get; }
|
||||
public ReadOnlyObservableCollection<EntryListItemVerticalViewModel> LatestEntries { get; }
|
||||
|
||||
private async Task ExecuteAddSubmission(CancellationToken arg)
|
||||
{
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
</ListBox>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<controls:HyperlinkButton Command="{CompiledBinding ViewWorkshopPage}" HorizontalAlignment="Center">
|
||||
<HyperlinkButton Command="{CompiledBinding ViewWorkshopPage}" HorizontalAlignment="Center">
|
||||
View workshop page
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
|
||||
<controls:Frame Grid.Column="1" Grid.Row="0" Name="RouterFrame" IsNavigationStackEnabled="False" CacheSize="0">
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="36" VerticalAlignment="Bottom" Text="Not logged in" IsVisible="{CompiledBinding CurrentUserViewModel.IsAnonymous}"/>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
|
||||
<controls:HyperlinkButton Classes="icon-button" ToolTip.Tip="View Wiki" NavigateUri="https://wiki.artemis-rgb.com?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
<HyperlinkButton Classes="icon-button" ToolTip.Tip="View Wiki" NavigateUri="https://wiki.artemis-rgb.com?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
<avalonia:MaterialIcon Kind="BookOpenOutline" />
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@
|
||||
<shared:EnumComboBox Value="{CompiledBinding PhysicalLayout}"></shared:EnumComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<controls:HyperlinkButton Grid.Row="1"
|
||||
<HyperlinkButton Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
IsVisible="{CompiledBinding IsKeyboardLayout}"
|
||||
Margin="0 10 0 0"
|
||||
@@ -47,7 +47,7 @@
|
||||
HorizontalAlignment="Right"
|
||||
NavigateUri="https://wiki.artemis-rgb.com/en/guides/developer/layouts/keyboard-layouts?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
Learn about physical layouts
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
|
||||
<ScrollViewer Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
|
||||
+2
-2
@@ -24,12 +24,12 @@
|
||||
</TextBlock>
|
||||
|
||||
|
||||
<controls:HyperlinkButton Grid.Row="0"
|
||||
<HyperlinkButton Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Top"
|
||||
NavigateUri="https://wiki.artemis-rgb.com/guides/user/profiles/layers/adaption-hints?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
Learn more about adaption hints
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
|
||||
<ScrollViewer Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="36" VerticalAlignment="Bottom" Text="Not logged in" IsVisible="{CompiledBinding CurrentUserViewModel.IsAnonymous}" />
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
|
||||
<controls:HyperlinkButton Classes="icon-button" ToolTip.Tip="View Wiki" NavigateUri="https://wiki.artemis-rgb.com?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
<HyperlinkButton Classes="icon-button" ToolTip.Tip="View Wiki" NavigateUri="https://wiki.artemis-rgb.com?mtm_campaign=artemis&mtm_kwd=workshop-wizard">
|
||||
<avalonia:MaterialIcon Kind="BookOpenOutline" />
|
||||
</controls:HyperlinkButton>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="1"
|
||||
|
||||
Reference in new issue
Block a user