From 9aef0bd3c372693657f1764c9bbd3950009080f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=81=D1=82=D1=80=D0=BE=D0=B2=20=D0=9C=D0=B8?= =?UTF-8?q?=D1=85=D0=B0=D0=B8=D0=BB=20=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 14 Nov 2025 18:15:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=BA=D0=BD=D0=BE=20"=D0=9E=20=D0=BF=D1=80=D0=B8=D0=BB?= =?UTF-8?q?=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B8"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлена кнопка "О приложении" в окне настроек (SettingsWindow.cs), а также окно "О приложении" (AboutWindow.cs) --- src/KeyKeeper/AboutWindow.cs | 50 +++++++++++++++++++++++++++++++++ src/KeyKeeper/SettingsWindow.cs | 15 ++++++++-- 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 src/KeyKeeper/AboutWindow.cs diff --git a/src/KeyKeeper/AboutWindow.cs b/src/KeyKeeper/AboutWindow.cs new file mode 100644 index 0000000..80df398 --- /dev/null +++ b/src/KeyKeeper/AboutWindow.cs @@ -0,0 +1,50 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Layout; +using Avalonia.Media; + +namespace KeyKeeper.Views; +public class AboutWindow : Window +{ + public AboutWindow() + { + this.Title = "О приложении"; + this.Width = 600; + this.Height = 400; + + var AboutKeyKeeper = new TextBlock + { + Text = "About Keykeeper", + HorizontalAlignment = HorizontalAlignment.Left, + FontSize = 50, + TextAlignment = TextAlignment.Left + }; + + var AboutText = new TextBlock + { + Text = "KeyKeeper is a personal password and key manager\nwhere you can save passwords and other login\ninformation, configure one-time code generation,\nand create encryption keys for personal use", + HorizontalAlignment = HorizontalAlignment.Left, + FontSize = 16, + TextAlignment = TextAlignment.Left, + Margin = new Thickness(0, 20, 0, 0) + }; + + var mainGrid = new Grid + { + VerticalAlignment = VerticalAlignment.Center, + HorizontalAlignment = HorizontalAlignment.Center + }; + + var innerStack = new StackPanel + { + Width = 400 + }; + + innerStack.Children.Add(AboutKeyKeeper); + innerStack.Children.Add(AboutText); + + mainGrid.Children.Add(innerStack); + + this.Content = mainGrid; + } +} \ No newline at end of file diff --git a/src/KeyKeeper/SettingsWindow.cs b/src/KeyKeeper/SettingsWindow.cs index 15f26ec..4f7ad2e 100644 --- a/src/KeyKeeper/SettingsWindow.cs +++ b/src/KeyKeeper/SettingsWindow.cs @@ -5,18 +5,27 @@ using Avalonia.Media; namespace KeyKeeper.Views; public class SettingsWindow : Window { + private async void OpenAbout() + { + var AboutWindow = new AboutWindow(); + await AboutWindow.ShowDialog(this); + } + public SettingsWindow() { this.Title = "Настройки"; this.Width = 400; this.Height = 300; - var textBlock = new TextBlock + var AboutButton = new Button { - Text = "Окно настроек", + Content = "О приложении", HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center, VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center, FontSize = 16 }; - this.Content = textBlock; + + AboutButton.Click += (sender, e) => OpenAbout(); + + this.Content = AboutButton; } }