mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Tweaked monospace font sizing
This commit is contained in:
1 parent
2ee170b803
commit
fcde1d4ecc
25 files changed
+281
-214
No files matched your search
@@ -1,6 +1,4 @@
|
||||
using System.Reactive;
|
||||
using System.Reactive.Linq;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Profile;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using ReactiveUI;
|
||||
|
||||
@@ -23,12 +21,6 @@ public class EntryTypeStepViewModel : SubmissionViewModel
|
||||
set => RaiseAndSetIfChanged(ref _selectedEntryType, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
|
||||
private void ExecuteContinue()
|
||||
{
|
||||
if (SelectedEntryType == null)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Security.Claims;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -29,12 +27,6 @@ public class LoginStepViewModel : SubmissionViewModel
|
||||
ContinueText = "Log In";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; } = null!;
|
||||
|
||||
private async Task ExecuteLogin(CancellationToken ct)
|
||||
{
|
||||
ContentDialogResult result = await _windowService.CreateContentDialog().WithViewModel(out WorkshopLoginViewModel _).WithTitle("Workshop login").ShowAsync();
|
||||
|
||||
+5
-6
@@ -6,31 +6,30 @@ using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs;
|
||||
using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using FluentAvalonia.Core;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Profile;
|
||||
|
||||
public class ProfileAdaptionHintsLayerViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IWindowService _windowService;
|
||||
private readonly IProfileService _profileService;
|
||||
private readonly ObservableAsPropertyHelper<string> _adaptionHintText;
|
||||
private readonly IProfileService _profileService;
|
||||
private readonly IWindowService _windowService;
|
||||
private int _adaptionHintCount;
|
||||
|
||||
public Layer Layer { get; }
|
||||
|
||||
public ProfileAdaptionHintsLayerViewModel(Layer layer, IWindowService windowService, IProfileService profileService)
|
||||
{
|
||||
_windowService = windowService;
|
||||
_profileService = profileService;
|
||||
_adaptionHintText = this.WhenAnyValue(vm => vm.AdaptionHintCount).Select(c => c == 1 ? "1 adaption hint" : $"{c} adaption hints").ToProperty(this, vm => vm.AdaptionHintText);
|
||||
|
||||
|
||||
Layer = layer;
|
||||
EditAdaptionHints = ReactiveCommand.CreateFromTask(ExecuteEditAdaptionHints);
|
||||
AdaptionHintCount = layer.Adapter.AdaptionHints.Count;
|
||||
}
|
||||
|
||||
public Layer Layer { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit> EditAdaptionHints { get; }
|
||||
|
||||
public int AdaptionHintCount
|
||||
|
||||
+4
-9
@@ -3,23 +3,22 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using DynamicData;
|
||||
using ReactiveUI;
|
||||
using DynamicData.Aggregation;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Profile;
|
||||
|
||||
public class ProfileAdaptionHintsStepViewModel : SubmissionViewModel
|
||||
{
|
||||
private readonly IWindowService _windowService;
|
||||
private readonly IProfileService _profileService;
|
||||
private readonly SourceList<ProfileAdaptionHintsLayerViewModel> _layers;
|
||||
private readonly IProfileService _profileService;
|
||||
private readonly IWindowService _windowService;
|
||||
|
||||
public ProfileAdaptionHintsStepViewModel(IWindowService windowService, IProfileService profileService, Func<Layer, ProfileAdaptionHintsLayerViewModel> getLayerViewModel)
|
||||
{
|
||||
@@ -36,18 +35,14 @@ public class ProfileAdaptionHintsStepViewModel : SubmissionViewModel
|
||||
this.WhenActivated((CompositeDisposable _) =>
|
||||
{
|
||||
if (State.EntrySource is ProfileConfiguration profileConfiguration && profileConfiguration.Profile != null)
|
||||
{
|
||||
_layers.Edit(l =>
|
||||
{
|
||||
l.Clear();
|
||||
l.AddRange(profileConfiguration.Profile.GetAllLayers().Select(getLayerViewModel));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
public ReactiveCommand<Layer, Unit> EditAdaptionHints { get; }
|
||||
public ReadOnlyObservableCollection<ProfileAdaptionHintsLayerViewModel> Layers { get; }
|
||||
|
||||
@@ -61,7 +56,7 @@ public class ProfileAdaptionHintsStepViewModel : SubmissionViewModel
|
||||
{
|
||||
if (Layers.Any(l => l.AdaptionHintCount == 0))
|
||||
return;
|
||||
|
||||
|
||||
if (State.EntryId == null)
|
||||
State.ChangeScreen<SpecificationsStepViewModel>();
|
||||
else
|
||||
|
||||
-7
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using Artemis.Core;
|
||||
@@ -52,12 +51,6 @@ public class ProfileSelectionStepViewModel : SubmissionViewModel
|
||||
set => RaiseAndSetIfChanged(ref _selectedProfile, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
|
||||
private void Update(ProfileConfiguration? profileConfiguration)
|
||||
{
|
||||
ProfilePreview.ProfileConfiguration = null;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
+28
-32
@@ -2,41 +2,38 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using Artemis.UI.Extensions;
|
||||
using Artemis.UI.Screens.Workshop.Entries;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Profile;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using Avalonia.Threading;
|
||||
using DynamicData;
|
||||
using ReactiveUI;
|
||||
using ReactiveUI.Validation.Extensions;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.SubmissionWizard.Steps;
|
||||
|
||||
public class SpecificationsStepViewModel : SubmissionViewModel
|
||||
{
|
||||
public SpecificationsStepViewModel(EntrySpecificationsViewModel entrySpecificationsViewModel)
|
||||
{
|
||||
EntrySpecificationsViewModel = entrySpecificationsViewModel;
|
||||
GoBack = ReactiveCommand.Create(ExecuteGoBack);
|
||||
Continue = ReactiveCommand.Create(ExecuteContinue, EntrySpecificationsViewModel.ValidationContext.Valid);
|
||||
private readonly Func<EntrySpecificationsViewModel> _getEntrySpecificationsViewModel;
|
||||
private EntrySpecificationsViewModel? _entrySpecificationsViewModel;
|
||||
|
||||
public SpecificationsStepViewModel(Func<EntrySpecificationsViewModel> getEntrySpecificationsViewModel)
|
||||
{
|
||||
_getEntrySpecificationsViewModel = getEntrySpecificationsViewModel;
|
||||
|
||||
GoBack = ReactiveCommand.Create(ExecuteGoBack);
|
||||
this.WhenActivated((CompositeDisposable d) =>
|
||||
{
|
||||
DisplayName = $"{State.EntryType} Information";
|
||||
|
||||
// Apply the state
|
||||
ApplyFromState();
|
||||
|
||||
EntrySpecificationsViewModel.ClearValidationRules();
|
||||
});
|
||||
}
|
||||
|
||||
public EntrySpecificationsViewModel EntrySpecificationsViewModel { get; }
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
public EntrySpecificationsViewModel? EntrySpecificationsViewModel
|
||||
{
|
||||
get => _entrySpecificationsViewModel;
|
||||
set => RaiseAndSetIfChanged(ref _entrySpecificationsViewModel, value);
|
||||
}
|
||||
|
||||
private void ExecuteGoBack()
|
||||
{
|
||||
@@ -59,46 +56,45 @@ public class SpecificationsStepViewModel : SubmissionViewModel
|
||||
|
||||
private void ExecuteContinue()
|
||||
{
|
||||
if (!EntrySpecificationsViewModel.ValidationContext.Validations.Any())
|
||||
{
|
||||
// The ValidationContext seems to update asynchronously, so stop and schedule a retry
|
||||
EntrySpecificationsViewModel.SetupDataValidation();
|
||||
Dispatcher.UIThread.Post(ExecuteContinue);
|
||||
if (EntrySpecificationsViewModel == null || !EntrySpecificationsViewModel.ValidationContext.GetIsValid())
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyToState();
|
||||
|
||||
if (!EntrySpecificationsViewModel.ValidationContext.GetIsValid())
|
||||
return;
|
||||
|
||||
State.ChangeScreen<SubmitStepViewModel>();
|
||||
}
|
||||
|
||||
private void ApplyFromState()
|
||||
{
|
||||
EntrySpecificationsViewModel viewModel = _getEntrySpecificationsViewModel();
|
||||
|
||||
// Basic fields
|
||||
EntrySpecificationsViewModel.Name = State.Name;
|
||||
EntrySpecificationsViewModel.Summary = State.Summary;
|
||||
EntrySpecificationsViewModel.Description = State.Description;
|
||||
viewModel.Name = State.Name;
|
||||
viewModel.Summary = State.Summary;
|
||||
viewModel.Description = State.Description;
|
||||
|
||||
// Tags
|
||||
EntrySpecificationsViewModel.Tags.Clear();
|
||||
EntrySpecificationsViewModel.Tags.AddRange(State.Tags);
|
||||
viewModel.Tags.Clear();
|
||||
viewModel.Tags.AddRange(State.Tags);
|
||||
|
||||
// Categories
|
||||
EntrySpecificationsViewModel.PreselectedCategories = State.Categories;
|
||||
viewModel.PreselectedCategories = State.Categories;
|
||||
|
||||
// Icon
|
||||
if (State.Icon != null)
|
||||
{
|
||||
State.Icon.Seek(0, SeekOrigin.Begin);
|
||||
EntrySpecificationsViewModel.IconBitmap = BitmapExtensions.LoadAndResize(State.Icon, 128);
|
||||
viewModel.IconBitmap = BitmapExtensions.LoadAndResize(State.Icon, 128);
|
||||
}
|
||||
|
||||
EntrySpecificationsViewModel = viewModel;
|
||||
Continue = ReactiveCommand.Create(ExecuteContinue, EntrySpecificationsViewModel.ValidationContext.Valid);
|
||||
}
|
||||
|
||||
private void ApplyToState()
|
||||
{
|
||||
if (EntrySpecificationsViewModel == null)
|
||||
return;
|
||||
|
||||
// Basic fields
|
||||
State.Name = EntrySpecificationsViewModel.Name;
|
||||
State.Summary = EntrySpecificationsViewModel.Summary;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using Artemis.UI.Screens.Workshop.Categories;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using Artemis.WebClient.Workshop.Services;
|
||||
using Avalonia.Media.Imaging;
|
||||
using IdentityModel;
|
||||
using ReactiveUI;
|
||||
using StrawberryShake;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Avalonia.Media.Imaging;
|
||||
|
||||
namespace Artemis.UI.Screens.Workshop.SubmissionWizard.Steps;
|
||||
|
||||
@@ -26,9 +25,9 @@ public class SubmitStepViewModel : SubmissionViewModel
|
||||
CurrentUser = authenticationService.Claims.FirstOrDefault(c => c.Type == JwtClaimTypes.Name)?.Value;
|
||||
GoBack = ReactiveCommand.Create(() => State.ChangeScreen<SpecificationsStepViewModel>());
|
||||
Continue = ReactiveCommand.Create(() => State.ChangeScreen<UploadStepViewModel>());
|
||||
|
||||
|
||||
ContinueText = "Submit";
|
||||
|
||||
|
||||
this.WhenActivated(d =>
|
||||
{
|
||||
if (State.Icon != null)
|
||||
@@ -37,6 +36,7 @@ public class SubmitStepViewModel : SubmissionViewModel
|
||||
IconBitmap = new Bitmap(State.Icon);
|
||||
IconBitmap.DisposeWith(d);
|
||||
}
|
||||
|
||||
Observable.FromAsync(workshopClient.GetCategories.ExecuteAsync).Subscribe(PopulateCategories).DisposeWith(d);
|
||||
});
|
||||
}
|
||||
@@ -55,19 +55,13 @@ public class SubmitStepViewModel : SubmissionViewModel
|
||||
set => RaiseAndSetIfChanged(ref _categories, value);
|
||||
}
|
||||
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
|
||||
private void PopulateCategories(IOperationResult<IGetCategoriesResult> result)
|
||||
{
|
||||
if (result.Data == null)
|
||||
Categories = null;
|
||||
else
|
||||
{
|
||||
Categories = new ReadOnlyObservableCollection<CategoryViewModel>(
|
||||
new ObservableCollection<CategoryViewModel>(result.Data.Categories.Where(c => State.Categories.Contains(c.Id)).Select(c => new CategoryViewModel(c)))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading;
|
||||
@@ -55,12 +54,6 @@ public class UploadStepViewModel : SubmissionViewModel
|
||||
this.WhenActivated(d => Observable.FromAsync(ExecuteUpload).Subscribe().DisposeWith(d));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; } = null!;
|
||||
|
||||
public int ProgressPercentage => _progressPercentage.Value;
|
||||
public bool ProgressIndeterminate => _progressIndeterminate.Value;
|
||||
|
||||
|
||||
+1
-7
@@ -27,7 +27,7 @@ public class ValidateEmailStepViewModel : SubmissionViewModel
|
||||
Continue = ReactiveCommand.Create(ExecuteContinue);
|
||||
Refresh = ReactiveCommand.CreateFromTask(ExecuteRefresh);
|
||||
Resend = ReactiveCommand.Create(() => Utilities.OpenUrl(WorkshopConstants.AUTHORITY_URL + "/account/confirm/resend"));
|
||||
|
||||
|
||||
ShowGoBack = false;
|
||||
ShowHeader = false;
|
||||
|
||||
@@ -43,12 +43,6 @@ public class ValidateEmailStepViewModel : SubmissionViewModel
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; } = null!;
|
||||
|
||||
public ReactiveCommand<Unit, Unit> Refresh { get; }
|
||||
public ReactiveCommand<Unit, Process?> Resend { get; }
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.WebClient.Workshop.Services;
|
||||
using IdentityModel;
|
||||
@@ -21,12 +19,6 @@ public class WelcomeStepViewModel : SubmissionViewModel
|
||||
ShowGoBack = false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ReactiveCommand<Unit, Unit> GoBack { get; } = null!;
|
||||
|
||||
private async Task ExecuteContinue()
|
||||
{
|
||||
bool loggedIn = await _authenticationService.AutoLogin(true);
|
||||
|
||||
@@ -6,15 +6,26 @@ namespace Artemis.UI.Screens.Workshop.SubmissionWizard;
|
||||
|
||||
public abstract class SubmissionViewModel : ValidatableViewModelBase
|
||||
{
|
||||
private ReactiveCommand<Unit, Unit>? _continue;
|
||||
private ReactiveCommand<Unit, Unit>? _goBack;
|
||||
private string _continueText = "Continue";
|
||||
private bool _showFinish;
|
||||
private bool _showGoBack = true;
|
||||
private bool _showHeader = true;
|
||||
|
||||
public SubmissionWizardState State { get; set; } = null!;
|
||||
|
||||
public abstract ReactiveCommand<Unit, Unit> Continue { get; }
|
||||
public abstract ReactiveCommand<Unit, Unit> GoBack { get; }
|
||||
|
||||
public ReactiveCommand<Unit, Unit>? Continue
|
||||
{
|
||||
get => _continue;
|
||||
set => RaiseAndSetIfChanged(ref _continue, value);
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit, Unit>? GoBack
|
||||
{
|
||||
get => _goBack;
|
||||
set => RaiseAndSetIfChanged(ref _goBack, value);
|
||||
}
|
||||
|
||||
public bool ShowHeader
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user