mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-02-04 02:43:32 +00:00
Visual tweaks
This commit is contained in:
parent
559434630d
commit
14c301a37e
@ -37,13 +37,14 @@
|
|||||||
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto, Auto">
|
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto, Auto">
|
||||||
<StackPanel Grid.Column="0"
|
<StackPanel Grid.Column="0"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
|
Spacing="4"
|
||||||
Classes="entry-clickable"
|
Classes="entry-clickable"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
PointerPressed="Entry_OnPointerPressed">
|
PointerPressed="Entry_OnPointerPressed">
|
||||||
<!-- Icon -->
|
<!-- Icon -->
|
||||||
<Border CornerRadius="6"
|
<Border CornerRadius="3"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Width="18"
|
Width="18"
|
||||||
Height="18"
|
Height="18"
|
||||||
@ -52,7 +53,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<TextBlock Margin="2 0" TextTrimming="CharacterEllipsis">
|
<TextBlock TextTrimming="CharacterEllipsis">
|
||||||
<Run Text="{CompiledBinding Entry.Name, FallbackValue=Title}" />
|
<Run Text="{CompiledBinding Entry.Name, FallbackValue=Title}" />
|
||||||
<Run Classes="subtitle">by</Run>
|
<Run Classes="subtitle">by</Run>
|
||||||
<Run Classes="subtitle" Text="{CompiledBinding Entry.Author, FallbackValue=Author}" />
|
<Run Classes="subtitle" Text="{CompiledBinding Entry.Author, FallbackValue=Author}" />
|
||||||
@ -69,6 +70,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10">
|
<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">
|
<Border Classes="badge" VerticalAlignment="Top">
|
||||||
<TextBlock Text="{CompiledBinding Entry.EntryType}"></TextBlock>
|
<TextBlock Text="{CompiledBinding Entry.EntryType}"></TextBlock>
|
||||||
</Border>
|
</Border>
|
||||||
@ -86,8 +88,8 @@
|
|||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
PointerPressed="Release_OnPointerPressed" />
|
PointerPressed="Release_OnPointerPressed" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
Text="{CompiledBinding CreatedAt, Converter={StaticResource DateTimeConverter}, ConverterParameter='humanize'}"
|
Text="{CompiledBinding CreatedAt, Converter={StaticResource DateTimeConverter}, ConverterParameter='humanize'}"
|
||||||
Classes="subtitle"
|
Classes="subtitle"
|
||||||
HorizontalAlignment="Right" />
|
HorizontalAlignment="Right" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public partial class RecentlyUpdatedItemViewModel : ActivatableViewModelBase
|
|||||||
{
|
{
|
||||||
_workshopService = workshopService;
|
_workshopService = workshopService;
|
||||||
_router = router;
|
_router = router;
|
||||||
Releases = entry.Releases;
|
Releases = entry.Releases.Take(3).ToList();
|
||||||
Entry = entry;
|
Entry = entry;
|
||||||
InstalledEntry = workshopService.GetInstalledEntry(entry.Id) ?? throw new InvalidOperationException("Entry is not installed");
|
InstalledEntry = workshopService.GetInstalledEntry(entry.Id) ?? throw new InvalidOperationException("Entry is not installed");
|
||||||
LatestRelease = Releases.First(r => r.Id == entry.LatestReleaseId);
|
LatestRelease = Releases.First(r => r.Id == entry.LatestReleaseId);
|
||||||
|
|||||||
@ -15,8 +15,8 @@
|
|||||||
</Styles>
|
</Styles>
|
||||||
</UserControl.Styles>
|
</UserControl.Styles>
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,*" MaxWidth="1000">
|
<Grid RowDefinitions="Auto,*">
|
||||||
<Grid Grid.Row="0" Grid.Column="0" Margin="0 22 0 10">
|
<Grid Grid.Row="0" Grid.Column="0" Margin="0 22 0 10" MaxWidth="1020">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition MinWidth="165" MaxWidth="400" />
|
<ColumnDefinition MinWidth="165" MaxWidth="400" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<TextBox Classes="search-box" Text="{CompiledBinding SearchEntryInput}" Watermark="Search updates" Margin="0 0 10 0" />
|
<TextBox Classes="search-box" Text="{CompiledBinding SearchEntryInput}" Watermark="Search updates" Margin="0 0 10 0" />
|
||||||
</Grid>
|
</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 Theme="{StaticResource TitleTextBlockStyle}">Looks like nothing updated in the last 30 days</TextBlock>
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
<Run>Any entries you download that recently received updates will show up here</Run>
|
<Run>Any entries you download that recently received updates will show up here</Run>
|
||||||
@ -34,7 +34,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1" Grid.Column="0" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" VerticalAlignment="Top">
|
<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>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<VirtualizingStackPanel />
|
<VirtualizingStackPanel />
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using System.Reactive.Linq;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Artemis.UI.Extensions;
|
using Artemis.UI.Extensions;
|
||||||
|
using Artemis.UI.Services.Interfaces;
|
||||||
using Artemis.UI.Shared.Routing;
|
using Artemis.UI.Shared.Routing;
|
||||||
using Artemis.WebClient.Workshop;
|
using Artemis.WebClient.Workshop;
|
||||||
using Artemis.WebClient.Workshop.Models;
|
using Artemis.WebClient.Workshop.Models;
|
||||||
@ -32,6 +33,7 @@ public partial class RecentlyUpdatedViewModel : RoutableScreen
|
|||||||
[Notify] private string? _searchEntryInput;
|
[Notify] private string? _searchEntryInput;
|
||||||
|
|
||||||
public RecentlyUpdatedViewModel(IWorkshopService workshopService,
|
public RecentlyUpdatedViewModel(IWorkshopService workshopService,
|
||||||
|
IWorkshopUpdateService workshopUpdateService,
|
||||||
IWorkshopClient client,
|
IWorkshopClient client,
|
||||||
IRouter router,
|
IRouter router,
|
||||||
Func<IGetRecentUpdates_Entries, RecentlyUpdatedItemViewModel> getRecentlyUpdatedItemViewModel)
|
Func<IGetRecentUpdates_Entries, RecentlyUpdatedItemViewModel> getRecentlyUpdatedItemViewModel)
|
||||||
@ -61,6 +63,7 @@ public partial class RecentlyUpdatedViewModel : RoutableScreen
|
|||||||
|
|
||||||
this.WhenActivatedAsync(async d =>
|
this.WhenActivatedAsync(async d =>
|
||||||
{
|
{
|
||||||
|
workshopUpdateService.MarkUpdatesAsSeen();
|
||||||
WorkshopReachable = await workshopService.ValidateWorkshopStatus(true, d.AsCancellationToken());
|
WorkshopReachable = await workshopService.ValidateWorkshopStatus(true, d.AsCancellationToken());
|
||||||
if (WorkshopReachable)
|
if (WorkshopReachable)
|
||||||
await GetEntries(d.AsCancellationToken());
|
await GetEntries(d.AsCancellationToken());
|
||||||
|
|||||||
@ -10,7 +10,7 @@ public interface IWorkshopUpdateService : IArtemisUIService
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A task that represents the asynchronous operation</returns>
|
/// <returns>A task that represents the asynchronous operation</returns>
|
||||||
Task AutoUpdateEntries();
|
Task AutoUpdateEntries();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Automatically updates the provided entry if a new version is available.
|
/// Automatically updates the provided entry if a new version is available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -22,4 +22,9 @@ public interface IWorkshopUpdateService : IArtemisUIService
|
|||||||
/// Disable workshop update notifications.
|
/// Disable workshop update notifications.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void DisableNotifications();
|
void DisableNotifications();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Marks the workshop updates as seen.
|
||||||
|
/// </summary>
|
||||||
|
void MarkUpdatesAsSeen();
|
||||||
}
|
}
|
||||||
@ -23,6 +23,7 @@ public class WorkshopUpdateService : IWorkshopUpdateService
|
|||||||
private readonly IPluginManagementService _pluginManagementService;
|
private readonly IPluginManagementService _pluginManagementService;
|
||||||
private readonly Lazy<IUpdateNotificationProvider> _updateNotificationProvider;
|
private readonly Lazy<IUpdateNotificationProvider> _updateNotificationProvider;
|
||||||
private readonly PluginSetting<bool> _showNotifications;
|
private readonly PluginSetting<bool> _showNotifications;
|
||||||
|
private readonly PluginSetting<int> _unseenUpdates;
|
||||||
|
|
||||||
public WorkshopUpdateService(ILogger logger,
|
public WorkshopUpdateService(ILogger logger,
|
||||||
IWorkshopClient client,
|
IWorkshopClient client,
|
||||||
@ -37,8 +38,9 @@ public class WorkshopUpdateService : IWorkshopUpdateService
|
|||||||
_pluginManagementService = pluginManagementService;
|
_pluginManagementService = pluginManagementService;
|
||||||
_updateNotificationProvider = updateNotificationProvider;
|
_updateNotificationProvider = updateNotificationProvider;
|
||||||
_showNotifications = settingsService.GetSetting("Workshop.ShowNotifications", true);
|
_showNotifications = settingsService.GetSetting("Workshop.ShowNotifications", true);
|
||||||
|
_unseenUpdates = settingsService.GetSetting("Workshop.UnseenUpdates", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task AutoUpdateEntries()
|
public async Task AutoUpdateEntries()
|
||||||
{
|
{
|
||||||
_logger.Information("Checking for workshop updates");
|
_logger.Information("Checking for workshop updates");
|
||||||
@ -60,6 +62,9 @@ public class WorkshopUpdateService : IWorkshopUpdateService
|
|||||||
|
|
||||||
if (updatedEntries > 0 && _showNotifications.Value)
|
if (updatedEntries > 0 && _showNotifications.Value)
|
||||||
_updateNotificationProvider.Value.ShowWorkshopNotification(updatedEntries);
|
_updateNotificationProvider.Value.ShowWorkshopNotification(updatedEntries);
|
||||||
|
|
||||||
|
_unseenUpdates.Value += updatedEntries;
|
||||||
|
_unseenUpdates.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> AutoUpdateEntry(InstalledEntry installedEntry)
|
public async Task<bool> AutoUpdateEntry(InstalledEntry installedEntry)
|
||||||
@ -122,4 +127,11 @@ public class WorkshopUpdateService : IWorkshopUpdateService
|
|||||||
_showNotifications.Value = false;
|
_showNotifications.Value = false;
|
||||||
_showNotifications.Save();
|
_showNotifications.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void MarkUpdatesAsSeen()
|
||||||
|
{
|
||||||
|
_unseenUpdates.Value = 0;
|
||||||
|
_unseenUpdates.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user