Skip to content

Commit af44b45

Browse files
committed
美化
1 parent 2309b00 commit af44b45

22 files changed

+204
-193
lines changed

src/ComputerLock/Components/About.razor

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,48 @@
22

33
<MudText Typo="Typo.h6" Class="mb-3">关于</MudText>
44

5-
<div class="d-flex align-center">
6-
<MudText Typo="Typo.subtitle2">@(Lang["Version"])</MudText>
7-
<MudChip T="string"
8-
Label="true"
9-
Disabled="true"
10-
Variant="Variant.Text">
11-
@(_version)
12-
</MudChip>
13-
14-
<MudButton Variant="Variant.Text"
15-
Color="Color.Secondary"
16-
Size="Size.Small"
17-
OnClick="OpenVersionHistory">@(Lang["VersionHistory"])</MudButton>
18-
</div>
19-
20-
<MudStack Row="true" Spacing="2">
21-
<MudButton Variant="Variant.Text"
22-
Color="Color.Secondary"
23-
Size="Size.Small"
24-
OnClick="CheckUpdateAsync">@(Lang["CheckUpdate"])</MudButton>
25-
26-
<MudCheckBox @bind-Value="@(AppSettings.IsAutoCheckUpdate)"
27-
@bind-Value:after="SaveSettings"
28-
Label="@(Lang["AutoCheckUpdate"])"
29-
Color="Color.Secondary"
30-
Size="Size.Small"
31-
Style="max-width: fit-content;" />
32-
</MudStack>
33-
34-
<MudDivider Class="mt-4 mb-10" />
35-
36-
<div class="d-flex flex-column align-center text-center">
37-
<MudAvatar Class="mb-2">
38-
<MudImage Src="images/icon.png"></MudImage>
5+
<div class="d-flex flex-column align-center mb-4">
6+
<MudAvatar Size="Size.Large" Class="mb-2">
7+
<MudImage Src="images/icon.png" Alt="Program Icon" Width="64" Height="64" Class="rounded-circle" />
398
</MudAvatar>
409

41-
<MudText Typo="Typo.subtitle1" Class="mb-2">@(Lang["Title"])</MudText>
10+
<MudText Typo="Typo.h6" Class="mb-2" Color="Color.Primary">@Lang["Title"]</MudText>
4211

43-
<MudStack Row="true" Spacing="2">
44-
<MudButton Href="@(Resource.HomePage)"
12+
<MudStack Spacing="3" Row="true" Justify="Justify.Center">
13+
<MudButton Href="@Resource.HomePage"
4514
Target="_blank"
4615
Variant="Variant.Text"
4716
StartIcon="@Icons.Material.Filled.Home"
48-
Size="Size.Small"
4917
Style="text-transform:none">
50-
@(Lang["HomePage"])
18+
@Lang["HomePage"]
5119
</MudButton>
5220

53-
<MudButton Href="@(Resource.GitHubUrl)"
21+
<MudButton Href="@Resource.GitHubUrl"
5422
Target="_blank"
5523
Variant="Variant.Text"
5624
StartIcon="@Icons.Custom.Brands.GitHub"
57-
Size="Size.Small"
5825
Style="text-transform:none">
5926
GitHub
6027
</MudButton>
6128
</MudStack>
62-
</div>
29+
30+
<MudDivider Class="my-5" />
31+
32+
<MudText Typo="Typo.body2" Class="mb-2">@($"{Lang["Version"]} {_version}")</MudText>
33+
34+
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Center" Class="mb-1">
35+
<MudButton Variant="Variant.Outlined" Size="Size.Small" Color="Color.Primary" OnClick="CheckUpdateAsync">
36+
@Lang["CheckUpdate"]
37+
</MudButton>
38+
<MudButton Variant="Variant.Outlined" Size="Size.Small" Color="Color.Primary" OnClick="OpenVersionHistory">
39+
@Lang["VersionHistory"]
40+
</MudButton>
41+
</MudStack>
42+
<MudCheckBox @bind-Value="AppSettings.IsAutoCheckUpdate"
43+
@bind-Value:after="SaveSettings"
44+
Label="@Lang["AutoCheckUpdate"]"
45+
Color="Color.Primary"
46+
Size="Size.Small" />
47+
</div>
48+
49+

src/ComputerLock/Components/About.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ protected override async Task OnInitializedAsync()
2424

2525
private async Task OpenVersionHistory()
2626
{
27-
await DialogService.ShowAsync<VersionHistoryDialog>("");
27+
var options = new DialogOptions { NoHeader = true, CloseOnEscapeKey = false, BackdropClick = false, BackgroundClass = "dialog-backdrop-filter", FullWidth = true };
28+
await DialogService.ShowAsync<VersionHistoryDialog>("", options);
2829
}
2930

3031
private async Task CheckUpdateAsync()

src/ComputerLock/Components/HotkeyInput.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<MudPaper Class="d-flex align-center" Elevation="0">
22
<MudText Typo="Typo.button" Style="@(Disabled ? "opacity:0.5;" : "")">@(Title)</MudText>
33
<MudButton Class="ml-3"
4-
Color="Color.Primary"
4+
Color="Color.Secondary"
55
Disabled="Disabled"
66
OnClick="SetShortcutKey">
77
@(_lockHotkeyDisplay)

src/ComputerLock/Components/HotkeyInput.razor.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,8 @@ public partial class HotkeyInput
3131

3232
private async Task SetShortcutKey()
3333
{
34-
var noHeader = new DialogOptions()
35-
{
36-
NoHeader = true,
37-
BackgroundClass = "dialog-blurry",
38-
CloseOnEscapeKey = false,
39-
};
40-
var dialog = await Dialog.ShowAsync<HotkeySetting>("", noHeader);
34+
var options = new DialogOptions { NoHeader = true, CloseOnEscapeKey = false, BackdropClick = false, BackgroundClass = "dialog-backdrop-filter" };
35+
var dialog = await Dialog.ShowAsync<HotkeySetting>("", options);
4136
var result = await dialog.Result;
4237
if (result!.Canceled)
4338
{
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<MudDialog DefaultFocus="DefaultFocus.FirstChild">
22
<DialogContent>
3-
<MudButton Variant="Variant.Text" @onkeydown="OnKeyDown">@(_text)</MudButton>
3+
<MudPaper Width="220px" Elevation="0" Class="d-flex justify-center">
4+
<MudButton Variant="Variant.Text" Color="Color.Secondary" @onkeydown="OnKeyDown">@(_text)</MudButton>
5+
</MudPaper>
46
</DialogContent>
57
<DialogActions>
8+
<MudButton OnClick="Cancel">@(Lang["Cancel"])</MudButton>
69
<MudButton Color="Color.Primary"
710
Disabled="@(_key.IsEmpty())"
811
OnClick="Submit">
912
@(Lang["Save"])
1013
</MudButton>
11-
<MudButton OnClick="Cancel">@(Lang["Cancel"])</MudButton>
1214
</DialogActions>
1315
</MudDialog>
Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
<MudDialog>
22
<DialogContent>
3-
<MudPaper Width="350px" Elevation="0">
4-
<MudPasswordField @bind-Value="@_currentPassword"
5-
Variant="Variant.Text"
6-
Label="@(Lang["CurrentPassword"])"
7-
IconSize="Size.Small" />
3+
<MudPaper Width="350px" Elevation="0" Class="pb-2">
4+
<MudStack Row="true" Justify="Justify.SpaceBetween" Class="mb-2">
5+
<MudText Typo="Typo.h6">@(Lang["ResetPassword"])</MudText>
6+
<MudIconButton Icon="@Icons.Material.Filled.Close"
7+
Color="Color.Default"
8+
Size="Size.Small"
9+
OnClick="Cancel" />
10+
</MudStack>
811

9-
<MudPasswordField @bind-Value="@_newPassword"
10-
Class="my-2"
11-
Variant="Variant.Text"
12-
Label="@(Lang["NewPassword"])"
13-
IconSize="Size.Small" />
12+
<MudStack Spacing="2">
13+
<MudPasswordField @bind-Value="@_currentPassword"
14+
Variant="Variant.Text"
15+
Label="@(Lang["CurrentPassword"])" />
1416

15-
<MudPasswordField @bind-Value="@_confirmPassword"
16-
Variant="Variant.Text"
17-
Label="@(Lang["ConfirmPassword"])"
18-
IconSize="Size.Small" />
17+
<MudPasswordField @bind-Value="@_newPassword"
18+
Variant="Variant.Text"
19+
Label="@(Lang["NewPassword"])" />
20+
21+
<MudPasswordField @bind-Value="@_confirmPassword"
22+
Variant="Variant.Text"
23+
Label="@(Lang["ConfirmPassword"])" />
24+
25+
</MudStack>
26+
27+
<MudButton Color="Color.Primary"
28+
FullWidth="true"
29+
Class="mt-4"
30+
Variant="Variant.Filled"
31+
OnClick="Submit">
32+
@(Lang["Save"])
33+
</MudButton>
1934
</MudPaper>
2035
</DialogContent>
21-
<DialogActions>
22-
<MudButton Color="Color.Primary"
23-
FullWidth="true"
24-
Variant="Variant.Filled"
25-
OnClick="Submit">
26-
@(Lang["Save"])
27-
</MudButton>
28-
</DialogActions>
2936
</MudDialog>

src/ComputerLock/Components/ResetPassword.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@ private void Submit()
5151
MudDialog.Close(DialogResult.Ok(newPassword));
5252
Snackbar.Add(Lang["SaveOk"], Severity.Success);
5353
}
54+
55+
private void Cancel() => MudDialog.Cancel();
5456
}
Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
<MudDialog>
22
<DialogContent>
3-
<MudPaper Width="350px" Elevation="0">
3+
<MudPaper Width="350px" Elevation="0" Class="pb-2">
4+
5+
<MudStack Row="true" Justify="Justify.SpaceBetween" Class="mb-2">
6+
<MudText Typo="Typo.h6">@(Lang["SetPassword"])</MudText>
7+
<MudIconButton Icon="@Icons.Material.Filled.Close"
8+
Color="Color.Default"
9+
Size="Size.Small"
10+
OnClick="Cancel" />
11+
</MudStack>
12+
413
<MudPasswordField @bind-Value="@_password"
514
Variant="Variant.Text"
6-
Label="@(Lang["SetPasswordInput"])"
7-
IconSize="Size.Small" />
15+
Label="@(Lang["SetPasswordInput"])" />
16+
17+
<MudButton Color="Color.Primary"
18+
FullWidth="true"
19+
Class="mt-4"
20+
Variant="Variant.Filled"
21+
OnClick="Submit">
22+
@(Lang["SetPasswordFinished"])
23+
</MudButton>
824
</MudPaper>
925
</DialogContent>
10-
<DialogActions>
11-
<MudButton Color="Color.Primary"
12-
FullWidth="true"
13-
Variant="Variant.Filled"
14-
OnClick="Submit">
15-
@(Lang["SetPasswordFinished"])
16-
</MudButton>
17-
</DialogActions>
1826
</MudDialog>
1927

src/ComputerLock/Components/SetPassword.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ private void Submit()
3131
MudDialog.Close(DialogResult.Ok(password));
3232
Snackbar.Add(Lang["SaveOk"], Severity.Success);
3333
}
34+
35+
private void Cancel() => MudDialog.Cancel();
3436
}

src/ComputerLock/Components/Settings/GeneralSettings.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
Label="true"
5555
Disabled="true"
5656
Variant="Variant.Text"
57+
Color="Color.Secondary"
5758
Size="Size.Small">
5859
@($"{_logFilesSize / 1024 / 1024:N2} MB")
5960
</MudChip>
@@ -62,7 +63,7 @@
6263
<div class="d-flex align-center">
6364
@if (!_logLoadingOk)
6465
{
65-
<MudProgressCircular Color="Color.Primary"
66+
<MudProgressCircular Color="Color.Secondary"
6667
Class="ml-2"
6768
Size="Size.Small"
6869
Indeterminate="true" />
@@ -87,6 +88,6 @@
8788
</div>
8889
<MudButton Class="mt-2"
8990
Variant="Variant.Text"
90-
Color="Color.Primary"
91+
Color="Color.Error"
9192
Size="Size.Small"
9293
OnClick="ResetSettingsAsync">@(Lang["ResetSettings"])</MudButton>

0 commit comments

Comments
 (0)