From f56bd319468485e0faa2d4ca254eef4a30675bb6 Mon Sep 17 00:00:00 2001 From: Chernykh Aleksandr Date: Fri, 7 Nov 2025 15:59:44 +0300 Subject: [PATCH 01/28] Create SettingsWindow.cs --- src/KeyKeeper/SettingsWindow.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/KeyKeeper/SettingsWindow.cs diff --git a/src/KeyKeeper/SettingsWindow.cs b/src/KeyKeeper/SettingsWindow.cs new file mode 100644 index 0000000..9459819 --- /dev/null +++ b/src/KeyKeeper/SettingsWindow.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KeyKeeper +{ + internal class SettingsWindow + { + } +} From 52c0474a209420fd0928f701fd2ac293ae2e54aa Mon Sep 17 00:00:00 2001 From: Chernykh Aleksandr Date: Fri, 7 Nov 2025 16:01:38 +0300 Subject: [PATCH 02/28] Update SettingsWindow.cs --- src/KeyKeeper/SettingsWindow.cs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/KeyKeeper/SettingsWindow.cs b/src/KeyKeeper/SettingsWindow.cs index 9459819..15f26ec 100644 --- a/src/KeyKeeper/SettingsWindow.cs +++ b/src/KeyKeeper/SettingsWindow.cs @@ -1,12 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Avalonia.Controls; +using Avalonia.Controls.Shapes; +using Avalonia.Media; -namespace KeyKeeper +namespace KeyKeeper.Views; +public class SettingsWindow : Window { - internal class SettingsWindow + public SettingsWindow() { + this.Title = "Настройки"; + this.Width = 400; + this.Height = 300; + var textBlock = new TextBlock + { + Text = "Окно настроек", + HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center, + VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center, + FontSize = 16 + }; + this.Content = textBlock; } } From e37d835b3a5df16be7afc2e0183f1b9838aeccda Mon Sep 17 00:00:00 2001 From: Chernykh Aleksandr Date: Fri, 7 Nov 2025 16:02:40 +0300 Subject: [PATCH 03/28] Update MainWindowViewModel.cs --- src/KeyKeeper/ViewModels/MainWindowViewModel.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/KeyKeeper/ViewModels/MainWindowViewModel.cs b/src/KeyKeeper/ViewModels/MainWindowViewModel.cs index 8832705..b95e069 100644 --- a/src/KeyKeeper/ViewModels/MainWindowViewModel.cs +++ b/src/KeyKeeper/ViewModels/MainWindowViewModel.cs @@ -1,6 +1,17 @@ -namespace KeyKeeper.ViewModels; +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using KeyKeeper.Views; + +namespace KeyKeeper.ViewModels; public partial class MainWindowViewModel : ViewModelBase { public string Greeting { get; } = "Welcome to Avalonia!"; + + [RelayCommand] + private void OpenSettings() + { + var settingsWindow = new SettingsWindow(); + settingsWindow.Show(); + } } From 020f873f418ae6048fbf696b201ef10b038946e7 Mon Sep 17 00:00:00 2001 From: Chernykh Aleksandr Date: Fri, 7 Nov 2025 16:03:26 +0300 Subject: [PATCH 04/28] Update MainWindow.axaml --- src/KeyKeeper/Views/MainWindow.axaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/KeyKeeper/Views/MainWindow.axaml b/src/KeyKeeper/Views/MainWindow.axaml index ef3c097..d8bf1a3 100644 --- a/src/KeyKeeper/Views/MainWindow.axaml +++ b/src/KeyKeeper/Views/MainWindow.axaml @@ -10,11 +10,12 @@ Title="KeyKeeper"> - - - + + + - + + + + + - - + + - + - + - + - + - + - + - + - + - - - - + + + + - + From d41e96a22f64e1c95434fc4c4f5b759f60e89589 Mon Sep 17 00:00:00 2001 From: Slavasil Date: Mon, 1 Dec 2025 13:52:56 +0300 Subject: [PATCH 27/28] replace grid with real listbox --- src/KeyKeeper/Views/MainWindow.axaml | 46 +++++++++++----------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/src/KeyKeeper/Views/MainWindow.axaml b/src/KeyKeeper/Views/MainWindow.axaml index 1b635e6..9b43550 100644 --- a/src/KeyKeeper/Views/MainWindow.axaml +++ b/src/KeyKeeper/Views/MainWindow.axaml @@ -8,6 +8,7 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="KeyKeeper.Views.MainWindow" x:DataType="vm:MainWindowViewModel" + Background="#fff" Icon="/Assets/icon.ico" Title="KeyKeeper"> @@ -70,34 +71,23 @@ CornerRadius="4" Padding="25"> - - - - - - - - - - - - - + + + + + + + + + + From 8c6a38850729a71bc904f33beb86dfce2a381752 Mon Sep 17 00:00:00 2001 From: Slavasil Date: Mon, 1 Dec 2025 14:39:20 +0300 Subject: [PATCH 28/28] fix app not closing: delete extra window --- src/KeyKeeper/Views/MainWindow.axaml.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/KeyKeeper/Views/MainWindow.axaml.cs b/src/KeyKeeper/Views/MainWindow.axaml.cs index ffb51ee..ec9a8a1 100644 --- a/src/KeyKeeper/Views/MainWindow.axaml.cs +++ b/src/KeyKeeper/Views/MainWindow.axaml.cs @@ -38,7 +38,6 @@ namespace KeyKeeper.Views { if (file.TryGetLocalPath() is string path) { - ShowMessage($"Создание нового хранилища: {path}"); (DataContext as MainWindowViewModel)!.CreateVault(path); OpenRepositoryWindow(); } @@ -70,25 +69,12 @@ namespace KeyKeeper.Views var file = files[0]; if (file.TryGetLocalPath() is string path) { - ShowMessage($"Открытие хранилища: {path}"); (DataContext as MainWindowViewModel)!.OpenVault(path); OpenRepositoryWindow(); } } } - private void ShowMessage(string message) - { - // Временное решение для показа сообщений - var messageBox = new Window - { - Title = "KeyKeeper", - Content = new TextBlock { Text = message, Margin = new Thickness(20) }, - SizeToContent = SizeToContent.WidthAndHeight, - WindowStartupLocation = WindowStartupLocation.CenterOwner - }; - messageBox.ShowDialog(this); - } private void OpenRepositoryWindow() { var repositoryWindow = new RepositoryWindow()