From ca6ced37c919e43d9a575919d08f070087fd70c4 Mon Sep 17 00:00:00 2001 From: Katter Date: Thu, 1 Aug 2024 14:52:39 +0500 Subject: [PATCH] Initial Appearance Settings --- .gitignore | 2 +- SightKeeper.Avalonia/App.axaml | 1 + .../Appearance/AppearanceSettingsViewModel.cs | 26 +++++++++++++++++++ .../Settings/SettingsTab.axaml | 16 +++++++++++- .../Setup/ViewModelsBootstrapper.cs | 2 ++ .../SightKeeper.Avalonia.csproj | 3 ++- SightKeeper.sln | 6 +++++ 7 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 SightKeeper.Avalonia/Settings/Appearance/AppearanceSettingsViewModel.cs diff --git a/.gitignore b/.gitignore index 0fb424f7..04a61bde 100644 --- a/.gitignore +++ b/.gitignore @@ -223,4 +223,4 @@ project.lock.json # End of core ignore list, below put you custom 'per project' settings (patterns or path) ##### -SightKeeper.Services/Darknet \ No newline at end of file +Generated/ \ No newline at end of file diff --git a/SightKeeper.Avalonia/App.axaml b/SightKeeper.Avalonia/App.axaml index 0d4fa107..5ec3813b 100644 --- a/SightKeeper.Avalonia/App.axaml +++ b/SightKeeper.Avalonia/App.axaml @@ -6,6 +6,7 @@ + \ No newline at end of file diff --git a/SightKeeper.Avalonia/Settings/Appearance/AppearanceSettingsViewModel.cs b/SightKeeper.Avalonia/Settings/Appearance/AppearanceSettingsViewModel.cs new file mode 100644 index 00000000..3eee2c1f --- /dev/null +++ b/SightKeeper.Avalonia/Settings/Appearance/AppearanceSettingsViewModel.cs @@ -0,0 +1,26 @@ +using System.ComponentModel; +using SightKeeper.Avalonia.ViewModels; + +namespace SightKeeper.Avalonia.Settings.Appearance; + +[Browsable(true)] +internal sealed class AppearanceSettingsViewModel : ViewModel, SettingsSection +{ + public string Header => "Appearance"; + + [Description("Custom window decorations look like the rest of the window and integrate with the contents, taking up less space. Off by default, using system decorations, providing a native experience.")] + public bool CustomDecorations + { + get => _customDecorations; + set + { + if (value == _customDecorations) + return; + _customDecorations = value; + OnPropertyChanged(); + + } + } + + private bool _customDecorations; +} \ No newline at end of file diff --git a/SightKeeper.Avalonia/Settings/SettingsTab.axaml b/SightKeeper.Avalonia/Settings/SettingsTab.axaml index d4fd0f21..c4169878 100644 --- a/SightKeeper.Avalonia/Settings/SettingsTab.axaml +++ b/SightKeeper.Avalonia/Settings/SettingsTab.axaml @@ -3,6 +3,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:settings="clr-namespace:SightKeeper.Avalonia.Settings" + xmlns:viewModels="clr-namespace:SightKeeper.Avalonia.ViewModels" + xmlns:generated="clr-namespace:Generated" + xmlns:games="clr-namespace:SightKeeper.Avalonia.Settings.Games" mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="300" x:Class="SightKeeper.Avalonia.Settings.SettingsTab" x:DataType="settings:SettingsViewModel"> @@ -18,7 +21,18 @@ - + + + + + + + + + + + + \ No newline at end of file diff --git a/SightKeeper.Avalonia/Setup/ViewModelsBootstrapper.cs b/SightKeeper.Avalonia/Setup/ViewModelsBootstrapper.cs index 122a19cd..d22b12e1 100644 --- a/SightKeeper.Avalonia/Setup/ViewModelsBootstrapper.cs +++ b/SightKeeper.Avalonia/Setup/ViewModelsBootstrapper.cs @@ -1,5 +1,6 @@ using Autofac; using SightKeeper.Avalonia.Settings; +using SightKeeper.Avalonia.Settings.Appearance; using SightKeeper.Avalonia.Settings.Games; using SightKeeper.Avalonia.ViewModels; @@ -11,6 +12,7 @@ public static void Setup(ContainerBuilder builder) { builder.RegisterType(); builder.RegisterType(); + builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType(); builder.RegisterType(); diff --git a/SightKeeper.Avalonia/SightKeeper.Avalonia.csproj b/SightKeeper.Avalonia/SightKeeper.Avalonia.csproj index 4f3a1650..63a6fa78 100644 --- a/SightKeeper.Avalonia/SightKeeper.Avalonia.csproj +++ b/SightKeeper.Avalonia/SightKeeper.Avalonia.csproj @@ -8,7 +8,6 @@ true Sight Keeper en - true true @@ -34,9 +33,11 @@ + + diff --git a/SightKeeper.sln b/SightKeeper.sln index a972745f..624b68e1 100644 --- a/SightKeeper.sln +++ b/SightKeeper.sln @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{EC16BB21 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SightKeeper.Data.Tests", "SightKeeper.Data.Tests\SightKeeper.Data.Tests.csproj", "{84712458-3E84-4279-AD52-58F24E88EBD5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sightful.Avalonia.Controls.PropertyGrid", "..\Sightful.Theme\Sightful.Avalonia.Controls.PropertyGrid\Sightful.Avalonia.Controls.PropertyGrid.csproj", "{F7114FB2-C0FF-4FC1-B047-7F2AB9F21EAD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -62,6 +64,10 @@ Global {84712458-3E84-4279-AD52-58F24E88EBD5}.Debug|Any CPU.Build.0 = Debug|Any CPU {84712458-3E84-4279-AD52-58F24E88EBD5}.Release|Any CPU.ActiveCfg = Release|Any CPU {84712458-3E84-4279-AD52-58F24E88EBD5}.Release|Any CPU.Build.0 = Release|Any CPU + {F7114FB2-C0FF-4FC1-B047-7F2AB9F21EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7114FB2-C0FF-4FC1-B047-7F2AB9F21EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7114FB2-C0FF-4FC1-B047-7F2AB9F21EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7114FB2-C0FF-4FC1-B047-7F2AB9F21EAD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {4D385463-EE5E-4257-84C8-75C0A0018879} = {EC16BB21-7A91-4224-BAB7-4C896D7B2920}