Skip to content

Commit fdbb692

Browse files
committed
feat: add icons to all message box dialogs for better UX
1 parent da2a071 commit fdbb692

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

Dialogs/ViewModels/AboutViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ namespace ProxyChecker.Dialogs.ViewModels;
1111
public partial class AboutViewModel(UpdateService updateService) : ObservableObject
1212
{
1313
[ObservableProperty] private string _appVersion = VersionInfo.GetDisplayVersion();
14-
[ObservableProperty] private string _description =
14+
[ObservableProperty]
15+
private string _description =
1516
"ProxyChecker 是一个高性能的代理检测工具,支持多协议检测、地理位置识别及并发验证。\n\n基于 Avalonia UI 与 Native AOT 技术构建,旨在提供跨平台、极致流畅的用户体验。";
1617
[ObservableProperty] private bool _isCheckingUpdate;
1718

@@ -45,13 +46,13 @@ await OverlayDialog.ShowModal<UpdateDialog, UpdateViewModel>(
4546
}
4647
else
4748
{
48-
await MessageBox.ShowOverlayAsync("当前已是最新版本。", "检查更新");
49+
await MessageBox.ShowOverlayAsync("当前已是最新版本。", "检查更新", icon: MessageBoxIcon.Information);
4950
}
5051
}
5152
catch (Exception ex)
5253
{
5354
var message = ex.InnerException?.Message ?? ex.Message;
54-
await MessageBox.ShowOverlayAsync($"检查更新失败: {message}", "错误");
55+
await MessageBox.ShowOverlayAsync($"检查更新失败: {message}", "错误", icon: MessageBoxIcon.Error);
5556
}
5657
finally
5758
{

ViewModels/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ await Drawer.ShowModal<SettingDialog, SettingModel>(
290290
}
291291
catch (Exception ex)
292292
{
293-
await MessageBox.ShowOverlayAsync($"打开设置失败: {ex.Message}", "错误");
293+
await MessageBox.ShowOverlayAsync($"打开设置失败: {ex.Message}", "错误", icon: MessageBoxIcon.Error);
294294
}
295295

296296
}
@@ -316,7 +316,7 @@ private async Task LoadFileAsync()
316316
}
317317
catch (Exception ex)
318318
{
319-
await MessageBox.ShowOverlayAsync($"打开设置失败: {ex.Message}", "错误");
319+
await MessageBox.ShowOverlayAsync($"打开设置失败: {ex.Message}", "错误", icon: MessageBoxIcon.Error);
320320
}
321321

322322
}

Views/MainWindow.axaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected override async Task<bool> CanClose()
155155
return true;
156156
}
157157

158-
var result = await MessageBox.ShowOverlayAsync("您确定要退出吗?", "退出提示", button: MessageBoxButton.YesNo);
158+
var result = await MessageBox.ShowOverlayAsync("您确定要退出吗?", "退出提示", button: MessageBoxButton.YesNo, icon: MessageBoxIcon.Warning);
159159
return result == MessageBoxResult.Yes;
160160
}
161161
}

0 commit comments

Comments
 (0)