Skip to content

Commit

Permalink
Initial Appearance Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Neakita committed Aug 1, 2024
1 parent c9547e0 commit ca6ced3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Generated/
1 change: 1 addition & 0 deletions SightKeeper.Avalonia/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Application.Styles>
<StyleInclude Source="avares://Sightful.Avalonia/DefaultTheme.axaml"/>
<StyleInclude Source="avares://Sightful.Avalonia.TreeDataGrid/SightfulTreeDataGridTheme.axaml"/>
<StyleInclude Source="avares://Sightful.Avalonia.Controls.PropertyGrid/PropertyHeader.axaml"/>
</Application.Styles>

</Application>
Original file line number Diff line number Diff line change
@@ -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;
}
16 changes: 15 additions & 1 deletion SightKeeper.Avalonia/Settings/SettingsTab.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -18,7 +21,18 @@
</TabStrip.ItemTemplate>
</TabStrip>
</Border>
<ContentControl Content="{Binding SelectedSection}"/>
<ContentControl Content="{Binding SelectedSection}">
<ContentControl.DataTemplates>
<DataTemplate x:DataType="games:GamesSettingsViewModel">
<games:GamesSettings/>
</DataTemplate>
<DataTemplate x:DataType="viewModels:ViewModel">
<Border Classes="outer wide-padding">
<generated:PropertyGrid/>
</Border>
</DataTemplate>
</ContentControl.DataTemplates>
</ContentControl>
</StackPanel>
</ScrollViewer>
</UserControl>
2 changes: 2 additions & 0 deletions SightKeeper.Avalonia/Setup/ViewModelsBootstrapper.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Autofac;
using SightKeeper.Avalonia.Settings;
using SightKeeper.Avalonia.Settings.Appearance;
using SightKeeper.Avalonia.Settings.Games;
using SightKeeper.Avalonia.ViewModels;

Expand All @@ -11,6 +12,7 @@ public static void Setup(ContainerBuilder builder)
{
builder.RegisterType<MainViewModel>();
builder.RegisterType<SettingsViewModel>();
builder.RegisterType<AppearanceSettingsViewModel>().As<SettingsSection>();
builder.RegisterType<GamesSettingsViewModel>().As<SettingsSection>();
builder.RegisterType<GamesRepositoryViewModel>();
builder.RegisterType<AddGameViewModel>();
Expand Down
3 changes: 2 additions & 1 deletion SightKeeper.Avalonia/SightKeeper.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<AssemblyTitle>Sight Keeper</AssemblyTitle>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PublishAot>true</PublishAot>
</PropertyGroup>

Expand All @@ -34,9 +33,11 @@
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="8.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Sightful.Theme\Sightful.Avalonia.Controls.PropertyGrid\Sightful.Avalonia.Controls.PropertyGrid.csproj" OutputItemType="Analyzer" />
<ProjectReference Include="..\..\Sightful.Theme\Sightful.Avalonia\Sightful.Avalonia.csproj" />
<ProjectReference Include="..\..\Sightful.Theme\Sightful.Avalonia.TreeDataGrid\Sightful.Avalonia.TreeDataGrid.csproj" />
<ProjectReference Include="..\SightKeeper.Data\SightKeeper.Data.csproj" />
Expand Down
6 changes: 6 additions & 0 deletions SightKeeper.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit ca6ced3

Please sign in to comment.