1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-02-04 02:43:32 +00:00

Visual tweaks

This commit is contained in:
Robert 2025-12-31 12:38:53 +01:00
parent 559434630d
commit 14c301a37e
6 changed files with 33 additions and 11 deletions

View File

@ -37,13 +37,14 @@
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto, Auto">
<StackPanel Grid.Column="0"
Grid.Row="0"
Spacing="4"
Classes="entry-clickable"
Orientation="Horizontal"
Cursor="Hand"
Background="Transparent"
PointerPressed="Entry_OnPointerPressed">
<!-- Icon -->
<Border CornerRadius="6"
<Border CornerRadius="3"
VerticalAlignment="Center"
Width="18"
Height="18"
@ -52,7 +53,7 @@
</Border>
<!-- Title -->
<TextBlock Margin="2 0" TextTrimming="CharacterEllipsis">
<TextBlock TextTrimming="CharacterEllipsis">
<Run Text="{CompiledBinding Entry.Name, FallbackValue=Title}" />
<Run Classes="subtitle">by</Run>
<Run Classes="subtitle" Text="{CompiledBinding Entry.Author, FallbackValue=Author}" />
@ -69,6 +70,7 @@
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10">
<TextBlock IsVisible="{CompiledBinding NotYetInstalled}">Not up-to-date</TextBlock>
<Border Classes="badge" VerticalAlignment="Top">
<TextBlock Text="{CompiledBinding Entry.EntryType}"></TextBlock>
</Border>

View File

@ -21,7 +21,7 @@ public partial class RecentlyUpdatedItemViewModel : ActivatableViewModelBase
{
_workshopService = workshopService;
_router = router;
Releases = entry.Releases;
Releases = entry.Releases.Take(3).ToList();
Entry = entry;
InstalledEntry = workshopService.GetInstalledEntry(entry.Id) ?? throw new InvalidOperationException("Entry is not installed");
LatestRelease = Releases.First(r => r.Id == entry.LatestReleaseId);

View File

@ -15,8 +15,8 @@
</Styles>
</UserControl.Styles>
<Grid RowDefinitions="Auto,*" MaxWidth="1000">
<Grid Grid.Row="0" Grid.Column="0" Margin="0 22 0 10">
<Grid RowDefinitions="Auto,*">
<Grid Grid.Row="0" Grid.Column="0" Margin="0 22 0 10" MaxWidth="1020">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="165" MaxWidth="400" />
<ColumnDefinition Width="*" />
@ -24,7 +24,7 @@
<TextBox Classes="search-box" Text="{CompiledBinding SearchEntryInput}" Watermark="Search updates" Margin="0 0 10 0" />
</Grid>
<StackPanel Grid.Row="1" Grid.Column="0" IsVisible="{CompiledBinding Empty}" Margin="0 50 0 0" Classes="empty-state">
<StackPanel Grid.Row="1" Grid.Column="0" IsVisible="{CompiledBinding Empty}" Margin="0 50 0 0" Classes="empty-state" MaxWidth="1000">
<TextBlock Theme="{StaticResource TitleTextBlockStyle}">Looks like nothing updated in the last 30 days</TextBlock>
<TextBlock>
<Run>Any entries you download that recently received updates will show up here</Run>
@ -34,7 +34,7 @@
</StackPanel>
<ScrollViewer Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
<ItemsControl ItemsSource="{CompiledBinding Entries}" Margin="0 0 20 0">
<ItemsControl ItemsSource="{CompiledBinding Entries}" Margin="0 0 20 0" MaxWidth="1000">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />

View File

@ -6,6 +6,7 @@ using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using Artemis.UI.Extensions;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared.Routing;
using Artemis.WebClient.Workshop;
using Artemis.WebClient.Workshop.Models;
@ -32,6 +33,7 @@ public partial class RecentlyUpdatedViewModel : RoutableScreen
[Notify] private string? _searchEntryInput;
public RecentlyUpdatedViewModel(IWorkshopService workshopService,
IWorkshopUpdateService workshopUpdateService,
IWorkshopClient client,
IRouter router,
Func<IGetRecentUpdates_Entries, RecentlyUpdatedItemViewModel> getRecentlyUpdatedItemViewModel)
@ -61,6 +63,7 @@ public partial class RecentlyUpdatedViewModel : RoutableScreen
this.WhenActivatedAsync(async d =>
{
workshopUpdateService.MarkUpdatesAsSeen();
WorkshopReachable = await workshopService.ValidateWorkshopStatus(true, d.AsCancellationToken());
if (WorkshopReachable)
await GetEntries(d.AsCancellationToken());

View File

@ -22,4 +22,9 @@ public interface IWorkshopUpdateService : IArtemisUIService
/// Disable workshop update notifications.
/// </summary>
void DisableNotifications();
/// <summary>
/// Marks the workshop updates as seen.
/// </summary>
void MarkUpdatesAsSeen();
}

View File

@ -23,6 +23,7 @@ public class WorkshopUpdateService : IWorkshopUpdateService
private readonly IPluginManagementService _pluginManagementService;
private readonly Lazy<IUpdateNotificationProvider> _updateNotificationProvider;
private readonly PluginSetting<bool> _showNotifications;
private readonly PluginSetting<int> _unseenUpdates;
public WorkshopUpdateService(ILogger logger,
IWorkshopClient client,
@ -37,6 +38,7 @@ public class WorkshopUpdateService : IWorkshopUpdateService
_pluginManagementService = pluginManagementService;
_updateNotificationProvider = updateNotificationProvider;
_showNotifications = settingsService.GetSetting("Workshop.ShowNotifications", true);
_unseenUpdates = settingsService.GetSetting("Workshop.UnseenUpdates", 0);
}
public async Task AutoUpdateEntries()
@ -60,6 +62,9 @@ public class WorkshopUpdateService : IWorkshopUpdateService
if (updatedEntries > 0 && _showNotifications.Value)
_updateNotificationProvider.Value.ShowWorkshopNotification(updatedEntries);
_unseenUpdates.Value += updatedEntries;
_unseenUpdates.Save();
}
public async Task<bool> AutoUpdateEntry(InstalledEntry installedEntry)
@ -122,4 +127,11 @@ public class WorkshopUpdateService : IWorkshopUpdateService
_showNotifications.Value = false;
_showNotifications.Save();
}
/// <inheritdoc />
public void MarkUpdatesAsSeen()
{
_unseenUpdates.Value = 0;
_unseenUpdates.Save();
}
}