Skip to content

Commit 6cc8a1f

Browse files
committed
美化界面
1 parent a7a0606 commit 6cc8a1f

File tree

7 files changed

+200
-102
lines changed

7 files changed

+200
-102
lines changed
Lines changed: 90 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,99 @@
11
<MudDrawer @bind-Open="@_isOpen"
2-
Class="pa-6"
3-
Anchor="Anchor.End"
4-
Elevation="1"
5-
Width="350px"
6-
Variant="@DrawerVariant.Temporary">
7-
<MudDrawerContainer>
2+
Class="pa-6"
3+
Anchor="Anchor.End"
4+
Elevation="1"
5+
Width="350px"
6+
Variant="@DrawerVariant.Temporary">
7+
<MudDrawerContainer>
88

9-
<MudSwitch Value="@(_isAutostart)"
10-
T="bool"
11-
ValueChanged="AutostartChange"
12-
Label="@(Lang["Autostart"])"
13-
Color="Color.Primary" />
9+
<MudSwitch Value="@(_isAutostart)"
10+
T="bool"
11+
ValueChanged="AutostartChange"
12+
Label="@(Lang["Autostart"])"
13+
Color="Color.Primary" />
1414

15-
<MudSwitch @bind-Value="@(AppSettings.IsHideWindowWhenLaunch)"
16-
@bind-Value:after="SaveSettings"
17-
Label="@(Lang["HideWindowWhenLaunch"])"
18-
Color="Color.Primary" />
19-
<MudSwitch @bind-Value="@(AppSettings.IsHideWindowWhenClose)"
20-
@bind-Value:after="SaveSettings"
21-
Label="@(Lang["HideWindowWhenClose"])"
22-
Color="Color.Primary" />
23-
<MudSwitch @bind-Value="@(AppSettings.IsAutoCheckUpdate)"
24-
@bind-Value:after="SaveSettings"
25-
Label="@(Lang["AutoCheckUpdate"])"
26-
Color="Color.Primary" />
15+
<MudSwitch @bind-Value="@(AppSettings.IsHideWindowWhenLaunch)"
16+
@bind-Value:after="SaveSettings"
17+
Label="@(Lang["HideWindowWhenLaunch"])"
18+
Color="Color.Primary" />
19+
<MudSwitch @bind-Value="@(AppSettings.IsHideWindowWhenClose)"
20+
@bind-Value:after="SaveSettings"
21+
Label="@(Lang["HideWindowWhenClose"])"
22+
Color="Color.Primary" />
23+
<MudSwitch @bind-Value="@(AppSettings.IsAutoCheckUpdate)"
24+
@bind-Value:after="SaveSettings"
25+
Label="@(Lang["AutoCheckUpdate"])"
26+
Color="Color.Primary" />
2727

28-
<MudSelect Class="mt-3"
29-
T="string"
30-
Label="语言 Lang"
31-
Value="@(AppSettings.Lang.ToString())"
32-
ValueChanged="LangValueChanged">
33-
<MudSelectItem Value="@("zh")">中文</MudSelectItem>
34-
<MudSelectItem Value="@("en")">en</MudSelectItem>
35-
</MudSelect>
28+
<MudSelect Class="mt-3"
29+
T="string"
30+
Label="语言 Lang"
31+
Value="@(AppSettings.Lang.ToString())"
32+
ValueChanged="LangValueChanged">
33+
<MudSelectItem Value="@("zh")">中文</MudSelectItem>
34+
<MudSelectItem Value="@("en")">en</MudSelectItem>
35+
</MudSelect>
3636

37-
<MudButton Class="mt-3"
38-
Variant="Variant.Text"
39-
Color="Color.Primary"
40-
Size="Size.Small"
41-
OnClick="ResetSettingsAsync">@(Lang["ResetSettings"])</MudButton>
4237

43-
<div class="mt-10 d-flex align-center">
44-
<MudChip T="string"
45-
Label="true"
46-
Disabled="true"
47-
Size="Size.Small">
48-
@(Lang["LogFiles"])
49-
</MudChip>
38+
<div class="mt-4 d-flex align-center">
39+
<MudText Typo="Typo.subtitle2">@(Lang["LogFiles"])</MudText>
40+
@if (_logLoadingOk)
41+
{
42+
<MudChip T="string"
43+
Label="true"
44+
Disabled="true"
45+
Variant="Variant.Text"
46+
Size="Size.Small">
47+
@($"{_logFilesSize / 1024 / 1024:N2} MB")
48+
</MudChip>
49+
}
50+
</div>
51+
<div class="d-flex align-center">
52+
@if (!_logLoadingOk)
53+
{
54+
<MudProgressCircular Color="Color.Primary"
55+
Class="ml-2"
56+
Size="Size.Small"
57+
Indeterminate="true" />
58+
}
59+
else
60+
{
61+
<MudButton Variant="Variant.Text"
62+
Color="Color.Primary"
63+
Size="Size.Small"
64+
OnClick="OpenLogPath">@(Lang["OpenLogs"])</MudButton>
65+
<MudButton Variant="Variant.Text"
66+
Color="Color.Primary"
67+
Size="Size.Small"
68+
OnClick="ClearLogAsync">@(Lang["RemoveLogs"])</MudButton>
69+
}
70+
</div>
71+
<MudDivider />
5072

51-
@if (!_logLoadingOk)
52-
{
53-
<MudProgressCircular Color="Color.Primary"
54-
Class="ml-2"
55-
Size="Size.Small"
56-
Indeterminate="true" />
57-
}
58-
else
59-
{
60-
<MudChip T="string"
61-
Label="true"
62-
Disabled="true"
63-
Size="Size.Small">
64-
@($"{_logFilesSize / 1024 / 1024:N2} MB")
65-
</MudChip>
73+
<div class="mt-4 d-flex align-center">
74+
<MudText Typo="Typo.subtitle2">@(Lang["Version"])</MudText>
75+
<MudChip T="string"
76+
Label="true"
77+
Disabled="true"
78+
Variant="Variant.Text"
79+
Size="Size.Small">
80+
@(_version)
81+
</MudChip>
82+
</div>
83+
<MudButton Variant="Variant.Text"
84+
Color="Color.Primary"
85+
Size="Size.Small"
86+
OnClick="CheckUpdateAsync">@(Lang["CheckUpdate"])</MudButton>
6687

67-
<MudButton Variant="Variant.Text"
68-
Color="Color.Primary"
69-
Size="Size.Small"
70-
OnClick="OpenLogPath">@(Lang["OpenLogs"])</MudButton>
71-
<MudButton Variant="Variant.Text"
72-
Color="Color.Primary"
73-
Size="Size.Small"
74-
OnClick="ClearLogAsync">@(Lang["RemoveLogs"])</MudButton>
75-
}
76-
</div>
77-
<div class="mt-4 d-flex align-center">
78-
<MudChip T="string"
79-
Label="true"
80-
Disabled="true"
81-
Size="Size.Small">
82-
@(_version)
83-
</MudChip>
84-
<MudButton Variant="Variant.Text"
85-
Color="Color.Primary"
86-
Size="Size.Small"
87-
OnClick="CheckUpdateAsync">@(Lang["CheckUpdate"])</MudButton>
88-
<MudButton Href="@(Resource.GitHubUrl)"
89-
Target="_blank"
90-
Variant="Variant.Text"
91-
Size="Size.Small"
92-
EndIcon="@Icons.Custom.Brands.GitHub"
93-
Color="Color.Primary">
94-
GitHub
95-
</MudButton>
96-
</div>
97-
</MudDrawerContainer>
88+
<MudDivider />
89+
90+
<div class="mt-4 d-flex align-center">
91+
<MudText Typo="Typo.subtitle2">@(Lang["Advanced"])</MudText>
92+
</div>
93+
<MudButton Class="mt-2"
94+
Variant="Variant.Text"
95+
Color="Color.Primary"
96+
Size="Size.Small"
97+
OnClick="ResetSettingsAsync">@(Lang["ResetSettings"])</MudButton>
98+
</MudDrawerContainer>
9899
</MudDrawer>

src/ComputerLock/Pages/Index.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ else
4646
</MudNumericField>
4747

4848
<MudPaper Class="d-flex align-center" Elevation="0">
49-
<MudText Typo="Typo.button">@(Lang["LockShortcutKey"])</MudText>
49+
<MudText Typo="Typo.button">@(Lang["LockHotkey"])</MudText>
5050
<MudButton Class="ml-3"
5151
Size="Size.Small"
5252
Color="Color.Primary"
@@ -72,8 +72,8 @@ else
7272
Size="Size.Small"
7373
CheckMark
7474
FixedContent>
75-
<MudToggleItem Value="@(ScreenUnlockMethods.Password)" Text="@(ScreenUnlockMethods.Password.GetDescription())" />
76-
<MudToggleItem Value="@(ScreenUnlockMethods.Hotkey)" Text="@(ScreenUnlockMethods.Hotkey.GetDescription())" />
75+
<MudToggleItem Value="@(ScreenUnlockMethods.Password)" Text="@(Lang["PasswordUnlock"])" />
76+
<MudToggleItem Value="@(ScreenUnlockMethods.Hotkey)" Text="@(Lang["HotkeyUnlock"])" />
7777
</MudToggleGroup>
7878

7979
<MudPaper Elevation="0" Height="210px">
@@ -145,7 +145,7 @@ else
145145
else if (AppSettings.ScreenUnlockMethod == ScreenUnlockMethods.Hotkey)
146146
{
147147
<MudAlert Severity="Severity.Success">当前不支持自定义快捷键,解锁和锁屏快捷键相同</MudAlert>
148-
<MudAlert Severity="Severity.Error">如果使用此选项,请确保已经设置了快捷键,否则会无法解锁!!(后续可能会加入适当校验)</MudAlert>
148+
<MudAlert Severity="Severity.Error">@(Lang["HotkeyUnlockTips"])</MudAlert>
149149
}
150150
</MudPaper>
151151
}

src/ComputerLock/Resources/Lang.Designer.cs

Lines changed: 49 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ComputerLock/Resources/Lang.en.resx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
<data name="Restarting" xml:space="preserve">
172172
<value>The setting is successful and will take effect after restarting.</value>
173173
</data>
174-
<data name="LockShortcutKey" xml:space="preserve">
175-
<value>Lock shortcut key</value>
174+
<data name="LockHotkey" xml:space="preserve">
175+
<value>Lock hotkey</value>
176176
</data>
177177
<data name="Invalid" xml:space="preserve">
178178
<value>Invalid</value>
@@ -345,4 +345,19 @@
345345
<data name="HideMouseCursor" xml:space="preserve">
346346
<value>Hide the mouse cursor</value>
347347
</data>
348+
<data name="Version" xml:space="preserve">
349+
<value>Version</value>
350+
</data>
351+
<data name="Advanced" xml:space="preserve">
352+
<value>Advanced</value>
353+
</data>
354+
<data name="PasswordUnlock" xml:space="preserve">
355+
<value>Password Unlock</value>
356+
</data>
357+
<data name="HotkeyUnlock" xml:space="preserve">
358+
<value>Hotkey Unlock</value>
359+
</data>
360+
<data name="HotkeyUnlockTips" xml:space="preserve">
361+
<value>If you use this option, please make sure that the hotkey is set, otherwise, it won't unlock! (Appropriate validation may be added in the future).</value>
362+
</data>
348363
</root>

src/ComputerLock/Resources/Lang.resx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<data name="Restarting" xml:space="preserve">
152152
<value></value>
153153
</data>
154-
<data name="LockShortcutKey" xml:space="preserve">
154+
<data name="LockHotkey" xml:space="preserve">
155155
<value></value>
156156
</data>
157157
<data name="Invalid" xml:space="preserve">
@@ -325,4 +325,19 @@
325325
<data name="HideMouseCursor" xml:space="preserve">
326326
<value></value>
327327
</data>
328+
<data name="Version" xml:space="preserve">
329+
<value></value>
330+
</data>
331+
<data name="Advanced" xml:space="preserve">
332+
<value></value>
333+
</data>
334+
<data name="PasswordUnlock" xml:space="preserve">
335+
<value></value>
336+
</data>
337+
<data name="HotkeyUnlock" xml:space="preserve">
338+
<value></value>
339+
</data>
340+
<data name="HotkeyUnlockTips" xml:space="preserve">
341+
<value></value>
342+
</data>
328343
</root>

0 commit comments

Comments
 (0)