Review feedback.

This commit is contained in:
Unnoen 2022-01-28 16:05:30 +11:00
parent 47ffa30222
commit 2c99f1f4f8
No known key found for this signature in database
GPG Key ID: 8F8E42252BA20553
9 changed files with 49 additions and 76 deletions

View File

@ -15,20 +15,18 @@
[Parameter] public IObservable<Percent> ProgressObserver { get; set; }
[Parameter] public string Text { get; set; }
[Parameter] public string? Text { get; set; }
protected override Task OnInitializedAsync()
protected override void OnInitialized()
{
var textPercentage = string.IsNullOrEmpty(Text);
ProgressObserver
.Sample(TimeSpan.FromMilliseconds(250))
.DistinctUntilChanged()
.DistinctUntilChanged(p => p.Value)
.Subscribe(p => {
CurrentProgress = p.Value;
if (textPercentage) Text = p.ToString();
InvokeAsync(StateHasChanged);
});
return base.OnInitializedAsync();
}
}

View File

@ -1,20 +0,0 @@
@using Wabbajack.App.Blazor.Pages
@namespace Wabbajack.App.Blazor.Components
<div id="step-logger">
@foreach (var step in value.StatusStep.Take(ShownSteps))
{
<div class="step">@step</div>
}
</div>
@code {
[Parameter]
public int ShownSteps { get; set; }
[Parameter]
public bool Reverse { get; set; }
[CascadingParameter]
public Installing value { get; set; }
}

View File

@ -1,33 +0,0 @@
#step-logger {
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
align-content: center;
.step {
&:nth-child(1) {
margin-left: 0.5rem;
font-size: 2rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.9);
}
&:nth-child(2) {
margin-left: 0.75rem;
font-size: 1.85rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.6);
filter: blur(1px);
}
&:nth-child(3) {
margin-left: 1rem;
font-size: 1.7rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.4);
filter: blur(1.5px);
}
}
}

View File

@ -23,7 +23,7 @@ public partial class Gallery
[Inject] private NavigationManager NavigationManager { get; set; } = default!;
[Inject] private ModListDownloadMaintainer Maintainer { get; set; } = default!;
[CascadingParameter] public IModalService Modal { get; set; }
[Inject] private IModalService Modal { get; set; } = default!;
private IObservable<Percent> DownloadProgress { get; set; }
private ModlistMetadata? DownloadingMetaData { get; set; }
@ -79,6 +79,7 @@ public partial class Gallery
var dispose = progress
.Sample(TimeSpan.FromMilliseconds(250))
.DistinctUntilChanged(p => p.Value)
.Subscribe(p => {
StateContainer.TaskBarState = new TaskBarState
{

View File

@ -90,7 +90,7 @@ public partial class Configure
}
}
private async void SelectInstallFolder()
private async Task SelectInstallFolder()
{
try
{
@ -103,7 +103,7 @@ public partial class Configure
}
}
private async void SelectDownloadFolder()
private async Task SelectDownloadFolder()
{
try
{

View File

@ -10,17 +10,16 @@
@if (Modlist is not null)
{
<div class="left-side">
<CascadingValue Value=this>
<InfoBlock Supertitle="@StatusCategory" Title="@Modlist.Name"/>
<StepLogger ShownSteps="3" Reverse="false" Steps="@StatusStep"/>
</CascadingValue>
<div class="step-logger">
@foreach (var step in StatusStep.Take(3))
{
<div class="step">@step</div>
}
</div>
</div>
<div class="right-side">
<InfoImage Image="@ModlistImage" Title="Some Mod Title" Subtitle="Author and others" Description="This mod adds something cool but I'm not going to tell you anything."/>
<div id="progressthing1"></div>
<div id="progressthing2"></div>
<div id="progressthing3"></div>
<div id="progressthing4"></div>
</div>
}
</div>

View File

@ -53,7 +53,7 @@ public partial class Installing
_shouldRender = true;
}
private async void Install()
private async Task Install()
{
if (Modlist is null) return;

View File

@ -48,6 +48,40 @@ $checkbox-size: 0.75rem;
.left-side, .right-side {
flex: 1;
margin: 1rem;
.step-logger {
display: flex;
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
align-content: center;
.step {
&:nth-child(1) {
margin-left: 0.5rem;
font-size: 2rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.9);
}
&:nth-child(2) {
margin-left: 0.75rem;
font-size: 1.85rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.6);
filter: blur(1px);
}
&:nth-child(3) {
margin-left: 1rem;
font-size: 1.7rem;
font-weight: 100;
color: rgba(255, 255, 255, 0.4);
filter: blur(1.5px);
}
}
}
}
}

View File

@ -36,12 +36,6 @@
<script src="_framework/blazor.webview.js"></script>
<script src="_content/Blazored.Modal/blazored.modal.js"></script>
<script>
async function setImageUsingStreaming(imageElementId, imageStream) {
const arrayBuffer = await imageStream.arrayBuffer();
const blob = new Blob([arrayBuffer]);
document.getElementById(imageElementId).src = URL.createObjectURL(blob);
}
async function getBlobUrlFromStream(imageStream) {
const arrayBuffer = await imageStream.arrayBuffer();
const blob = new Blob([arrayBuffer]);