mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-16 21:36:31 +03:00
Добавлена кнопка и окно "О приложении"
Добавлена кнопка "О приложении" в окне настроек (SettingsWindow.cs), а также окно "О приложении" (AboutWindow.cs)
This commit is contained in:
50
src/KeyKeeper/AboutWindow.cs
Normal file
50
src/KeyKeeper/AboutWindow.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,18 +5,27 @@ using Avalonia.Media;
|
|||||||
namespace KeyKeeper.Views;
|
namespace KeyKeeper.Views;
|
||||||
public class SettingsWindow : Window
|
public class SettingsWindow : Window
|
||||||
{
|
{
|
||||||
|
private async void OpenAbout()
|
||||||
|
{
|
||||||
|
var AboutWindow = new AboutWindow();
|
||||||
|
await AboutWindow.ShowDialog(this);
|
||||||
|
}
|
||||||
|
|
||||||
public SettingsWindow()
|
public SettingsWindow()
|
||||||
{
|
{
|
||||||
this.Title = "Настройки";
|
this.Title = "Настройки";
|
||||||
this.Width = 400;
|
this.Width = 400;
|
||||||
this.Height = 300;
|
this.Height = 300;
|
||||||
var textBlock = new TextBlock
|
var AboutButton = new Button
|
||||||
{
|
{
|
||||||
Text = "Окно настроек",
|
Content = "О приложении",
|
||||||
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center,
|
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center,
|
||||||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
|
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
|
||||||
FontSize = 16
|
FontSize = 16
|
||||||
};
|
};
|
||||||
this.Content = textBlock;
|
|
||||||
|
AboutButton.Click += (sender, e) => OpenAbout();
|
||||||
|
|
||||||
|
this.Content = AboutButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user