From cd4391c88f14de67d3f54f105df23bf6a2b438af Mon Sep 17 00:00:00 2001 From: Kurokitu Date: Fri, 17 May 2024 01:08:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TuneLab/GUI/Dialog.axaml | 3 +- TuneLab/TuneLab.csproj | 3 ++ TuneLab/Views/LyricInput.axaml | 58 +++++++++++++++---------------- TuneLab/Views/LyricInput.axaml.cs | 23 +++++++----- TuneLab/Views/MainWindow.axaml | 10 ------ TuneLab/Views/MainWindow.axaml.cs | 3 +- 6 files changed, 47 insertions(+), 53 deletions(-) diff --git a/TuneLab/GUI/Dialog.axaml b/TuneLab/GUI/Dialog.axaml index df0962a..a80a75c 100644 --- a/TuneLab/GUI/Dialog.axaml +++ b/TuneLab/GUI/Dialog.axaml @@ -9,8 +9,7 @@ Height="204" ExtendClientAreaChromeHints="NoChrome" ExtendClientAreaTitleBarHeightHint="40" - ExtendClientAreaToDecorationsHint="True" - UseLayoutRounding="True"> + ExtendClientAreaToDecorationsHint="True"> - - - - - + ExtendClientAreaToDecorationsHint="True"> + + + - + + + - - - - - - - + + + + + + - + - - - - - + + + + + + - + diff --git a/TuneLab/Views/LyricInput.axaml.cs b/TuneLab/Views/LyricInput.axaml.cs index 7b0ea1e..4f28caf 100644 --- a/TuneLab/Views/LyricInput.axaml.cs +++ b/TuneLab/Views/LyricInput.axaml.cs @@ -1,16 +1,14 @@ using Avalonia.Controls; -using Avalonia.Controls.Chrome; -using System; -using TuneLab.Utils; -using TuneLab.GUI; -using TuneLab.GUI.Components; -using CheckBox = TuneLab.GUI.Components.CheckBox; using Avalonia.Layout; -using Button = TuneLab.GUI.Components.Button; using Avalonia.Media; -using TuneLab.Data; using System.Collections.Generic; using System.Linq; +using TuneLab.Data; +using TuneLab.GUI; +using TuneLab.GUI.Components; +using TuneLab.Utils; +using Button = TuneLab.GUI.Components.Button; +using CheckBox = TuneLab.GUI.Components.CheckBox; namespace TuneLab.Views; @@ -25,9 +23,16 @@ internal partial class LyricInput : Window WindowStartupLocation = WindowStartupLocation.CenterScreen; Topmost = true; - this.DataContext = this; this.Background = Style.INTERFACE.ToBrush(); TitleBar.Background = Style.BACK.ToBrush(); + TitleLabel.Foreground = Style.TEXT_LIGHT.ToBrush(); + + var closeButton = new Button() { Width = 48, Height = 40 } + .AddContent(new() { Item = new BorderItem() { CornerRadius = 0 }, ColorSet = new() { HoveredColor = Colors.White.Opacity(0.2), PressedColor = Colors.White.Opacity(0.2) } }) + .AddContent(new() { Item = new IconItem() { Icon = Assets.WindowClose }, ColorSet = new() { Color = Style.TEXT_LIGHT.Opacity(0.7) } }); + closeButton.Clicked += () => Close(); + + WindowControl.Children.Add(closeButton); mLyricInputBox = new TextInput(); mLyricInputBox.AcceptsReturn = true; diff --git a/TuneLab/Views/MainWindow.axaml b/TuneLab/Views/MainWindow.axaml index 5a73a53..70b8f93 100644 --- a/TuneLab/Views/MainWindow.axaml +++ b/TuneLab/Views/MainWindow.axaml @@ -10,17 +10,7 @@ ExtendClientAreaChromeHints="NoChrome" ExtendClientAreaTitleBarHeightHint="40" ExtendClientAreaToDecorationsHint="True" - UseLayoutRounding="True" SizeChanged="Window_SizeChanged"> - - - - diff --git a/TuneLab/Views/MainWindow.axaml.cs b/TuneLab/Views/MainWindow.axaml.cs index 6ee4c7b..6d50f44 100644 --- a/TuneLab/Views/MainWindow.axaml.cs +++ b/TuneLab/Views/MainWindow.axaml.cs @@ -37,7 +37,7 @@ public MainWindow() this.AttachDevTools(); #endif - Focusable = true; + Focusable = false; IsTabStop = false; isCloseConfirm = false; Background = Style.BACK.ToBrush(); @@ -129,7 +129,6 @@ private void AttachWindowStateHandler() } break; case WindowState.Minimized: - Trace.WriteLine("窗口状态:最小化"); break; } From d5b3971e603cc2fbb5017f0b87ed93298b1220f4 Mon Sep 17 00:00:00 2001 From: Kurokitu Date: Fri, 17 May 2024 01:15:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=92=A4=E9=94=80=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=BF=98=E5=8E=9F=E7=9A=84=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TuneLab/Views/MainWindow.axaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TuneLab/Views/MainWindow.axaml.cs b/TuneLab/Views/MainWindow.axaml.cs index 6d50f44..6932aa1 100644 --- a/TuneLab/Views/MainWindow.axaml.cs +++ b/TuneLab/Views/MainWindow.axaml.cs @@ -37,7 +37,7 @@ public MainWindow() this.AttachDevTools(); #endif - Focusable = false; + Focusable = true; IsTabStop = false; isCloseConfirm = false; Background = Style.BACK.ToBrush(); From 0d84352595301e50b40fc2751a76e9d13bad568c Mon Sep 17 00:00:00 2001 From: Kurokitu Date: Fri, 17 May 2024 01:25:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E5=92=8C=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TuneLab/Views/LyricInput.axaml | 4 ++-- TuneLab/Views/LyricInput.axaml.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TuneLab/Views/LyricInput.axaml b/TuneLab/Views/LyricInput.axaml index 4a02fdc..172c106 100644 --- a/TuneLab/Views/LyricInput.axaml +++ b/TuneLab/Views/LyricInput.axaml @@ -19,7 +19,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/TuneLab/Views/LyricInput.axaml.cs b/TuneLab/Views/LyricInput.axaml.cs index 4f28caf..1361dbb 100644 --- a/TuneLab/Views/LyricInput.axaml.cs +++ b/TuneLab/Views/LyricInput.axaml.cs @@ -14,7 +14,7 @@ namespace TuneLab.Views; internal partial class LyricInput : Window { - LyricInput() + public LyricInput() { InitializeComponent(); Focusable = true;