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; } }