From 92dddc6b28718a031305d6ce7ad46f378750e08f Mon Sep 17 00:00:00 2001 From: Kurokitu Date: Sat, 20 Jul 2024 02:44:23 +0800 Subject: [PATCH] =?UTF-8?q?UpdateLog=E6=9B=B4=E6=8D=A2=E4=B8=BAMarkdown?= =?UTF-8?q?=E5=B9=B6=E5=B0=81=E8=A3=85=E4=BA=86=E6=96=B0=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TuneLab/GUI/UpdateDialog.axaml | 55 ++++++++++++++++++ TuneLab/GUI/UpdateDialog.axaml.cs | 78 ++++++++++++++++++++++++++ TuneLab/TuneLab.csproj | 1 + TuneLab/UI/MainWindow/Editor/Editor.cs | 13 ++--- 4 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 TuneLab/GUI/UpdateDialog.axaml create mode 100644 TuneLab/GUI/UpdateDialog.axaml.cs diff --git a/TuneLab/GUI/UpdateDialog.axaml b/TuneLab/GUI/UpdateDialog.axaml new file mode 100644 index 0000000..d922d65 --- /dev/null +++ b/TuneLab/GUI/UpdateDialog.axaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TuneLab/GUI/UpdateDialog.axaml.cs b/TuneLab/GUI/UpdateDialog.axaml.cs new file mode 100644 index 0000000..d2f46ff --- /dev/null +++ b/TuneLab/GUI/UpdateDialog.axaml.cs @@ -0,0 +1,78 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Media; +using System; +using TuneLab.Utils; +using Button = TuneLab.GUI.Components.Button; +using Markdown.Avalonia; +using TuneLab.I18N; + +namespace TuneLab.GUI; + +internal partial class UpdateDialog : Window +{ + public enum ButtonType + { + Primary, + Normal + } + + private Grid titleBar; + private Label titleLabel; + private SelectableTextBlock messageTextBlock; + private MarkdownScrollViewer markDownScrollViewer; + + public UpdateDialog() + { + InitializeComponent(); + Focusable = true; + CanResize = false; + WindowState = WindowState.Normal; + WindowStartupLocation = WindowStartupLocation.CenterScreen; + Topmost = true; + + this.DataContext = this; + this.Background = Style.BACK.ToBrush(); + Content.Background = Style.INTERFACE.ToBrush(); + + titleBar = this.FindControl("TitleBar") ?? throw new InvalidOperationException("TitleBar not found"); + titleLabel = this.FindControl