Changed some UI and added changing fonts

This commit is contained in:
BOT Alex 2023-08-27 06:22:01 +02:00
parent ec55964c46
commit 46664fac59
13 changed files with 133 additions and 20 deletions

View file

@ -35,14 +35,20 @@
</MudContainer>
<MudContainer Class="justify-center d-flex">
<MudCheckBox Class="mr-6" @bind-Checked="@IsEasyMode" Label="Easy mode" Color="Color.Primary"></MudCheckBox>
<MudStack Class="pt-4 " Spacing="0">
<MudContainer Class="pa-4">
<MudText Typo="Typo.h6" Class="fw-bold">Modifiers:</MudText>
<MudCheckBox Class="mr-6" @bind-Checked="@IgnoreTone" Label="Ignore pinyin tones" Color="Color.Primary"></MudCheckBox>
<MudCheckBox Class="mr-6" @bind-Checked="@UseChangingFonts" Label="Changing fonts" Color="Color.Primary"></MudCheckBox>
</MudContainer>
</MudStack>
</MudContainer>
<MudContainer Class="pt-16 justify-center d-flex">
<MudContainer Class="pt-4 justify-center d-flex">
@if (Charecters != null)
{
<MudPaper Class="overflow-scroll rounded-0" Style="height: 50vh;" Elevation="1">
<MudDataGrid FixedHeader=true Items="@Charecters" Breakpoint="Breakpoint.None">
<MudPaper Class="overflow-scroll rounded-lg" Style="height: 40vh;" Elevation="1">
<MudDataGrid Style="" SortMode="SortMode.None" Height="500" FixedHeader=true Items="@Charecters" Breakpoint="Breakpoint.None">
<Columns>
<PropertyColumn Property="x => x.charcter" Title="CChar" />
<PropertyColumn Property="x => x.pinyin" Title="Pinyin" />
@ -90,15 +96,27 @@
bool continueDataExists = false;
int continueCharectersLeft = -1;
private bool isEasyMode;
private bool ignoreTone;
public bool IsEasyMode
public bool IgnoreTone
{
get { return isEasyMode; }
get { return ignoreTone; }
set
{
isEasyMode = value;
SetEasyMode();
ignoreTone = value;
SetIgnoreTone();
}
}
private bool useChangingFonts;
public bool UseChangingFonts
{
get { return useChangingFonts; }
set
{
useChangingFonts = value;
SetChangingFonts();
}
}
@ -153,9 +171,14 @@
StateHasChanged();
}
async void SetEasyMode()
async void SetIgnoreTone()
{
await localStorage.SetItemAsync("EasyMode", isEasyMode);
await localStorage.SetItemAsync("IgnoreTone", ignoreTone);
}
async void SetChangingFonts()
{
await localStorage.SetItemAsync("ChangingFonts", UseChangingFonts);
}
async Task LoadAllChunksIntoLocalStorage()
@ -215,9 +238,14 @@
continueCharectersLeft = await localStorage.GetItemAsync<int>("ContinueCharectersLeft");
}
if (await localStorage.ContainKeyAsync("EasyMode"))
if (await localStorage.ContainKeyAsync("IgnoreTone"))
{
isEasyMode = await localStorage.GetItemAsync<bool>("EasyMode");
ignoreTone = await localStorage.GetItemAsync<bool>("IgnoreTone");
}
if (await localStorage.ContainKeyAsync("ChangingFonts"))
{
UseChangingFonts = await localStorage.GetItemAsync<bool>("ChangingFonts");
}
}
}