Skip to content

Commit 6f7cca7

Browse files
committed
Unfucked
the project
1 parent 72ca106 commit 6f7cca7

63 files changed

Lines changed: 3675 additions & 3894 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Amethyst.Contract/Contract.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,6 @@ public interface ITrackingDevice
9999
[DefaultValue(false)]
100100
bool IsAppOrientationSupported { get; }
101101

102-
/// <summary>
103-
/// To support settings daemon and register the layout root,
104-
/// the device must properly report it first
105-
/// -> will lead to showing an additional 'settings' button
106-
/// Note: each device has to save its settings independently
107-
/// and may use the K2AppData from the Paths' class
108-
/// Tip: you can hide your device's settings by marking this as 'false',
109-
/// and change it back to 'true' when you're ready
110-
/// </summary>
111-
[DefaultValue(false)]
112-
bool IsSettingsDaemonSupported { get; }
113-
114102
/// <summary>
115103
/// Settings UI root / MUST BE OF TYPE Avalonia.Controls.UserControl
116104
/// Return new() of your implemented Page, and that's basically it!
@@ -174,18 +162,6 @@ public interface ITrackingDevice
174162
/// </summary>
175163
public interface IServiceEndpoint
176164
{
177-
/// <summary>
178-
/// To support settings daemon and register the layout root,
179-
/// the device must properly report it first
180-
/// -> will lead to showing an additional 'settings' button
181-
/// Note: each device has to save its settings independently
182-
/// and may use the K2AppData from the Paths' class
183-
/// Tip: you can hide your device's settings by marking this as 'false',
184-
/// and change it back to 'true' when you're ready
185-
/// </summary>
186-
[DefaultValue(false)]
187-
bool IsSettingsDaemonSupported { get; }
188-
189165
/// <summary>
190166
/// Settings UI root / MUST BE OF TYPE Microsoft.UI.Xaml.Controls.Page
191167
/// Return new() of your implemented Page, and that's basically it!

Amethyst.Desktop/Amethyst.Desktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
66
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
77
</PropertyGroup>
8-
8+
99
<PropertyGroup>
1010
<OutputType>WinExe</OutputType>
1111
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>

Amethyst/Amethyst.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<NoWarn>$(NoWarn);NU1507</NoWarn>
77
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
88
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
9+
<LangVersion>latest</LangVersion>
10+
<Version>2.0.0.0</Version>
911
</PropertyGroup>
1012

1113
<ItemGroup>
@@ -26,12 +28,12 @@
2628
<PackageReference Include="Markdown.Avalonia" Version="11.0.3-a1"/>
2729
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0"/>
2830
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
29-
<PackageReference Include="RestSharp" Version="112.1.0" />
30-
<PackageReference Include="Splat" Version="16.2.1" />
31+
<PackageReference Include="RestSharp" Version="112.1.0"/>
32+
<PackageReference Include="Splat" Version="16.2.1"/>
3133
<PackageReference Include="System.ComponentModel.Composition" Version="10.0.0-preview.5.25277.114"/>
3234
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="10.0.0-preview.5.25277.114"/>
3335
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="10.0.0-preview.5.25277.114"/>
34-
<PackageReference Include="Xaml.Behaviors.Avalonia" Version="11.3.2" />
36+
<PackageReference Include="Xaml.Behaviors.Avalonia" Version="11.3.2"/>
3537
</ItemGroup>
3638

3739
<ItemGroup>

Amethyst/App.axaml

Lines changed: 38 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:sty="using:FluentAvalonia.Styling"
44
x:Class="Amethyst.App"
5-
xmlns:local="using:Amethyst"
65
xmlns:utils="clr-namespace:Amethyst.Utils"
7-
xmlns:fluent="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
8-
x:DataType="local:App">
6+
xmlns:fluent="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent">
97
<Application.Resources>
108
<ResourceDictionary>
119
<utils:InverseBoolConverter x:Key="InverseBoolConverter" />
@@ -14,28 +12,26 @@
1412
<utils:OpacityHalfBoolConverter x:Key="BoolToOpacityHalfConverter" />
1513
<utils:OpacityHalfBoolInvertedConverter x:Key="BoolToOpacityHalfInvertedConverter" />
1614

17-
<SolidColorBrush x:Key="AccentButtonBorderBrush" Color="HotPink" />
18-
<SolidColorBrush x:Key="AcrylicBackgroundFillColorBaseBrush" Color="HotPink" />
19-
<SolidColorBrush x:Key="AcrylicInAppFillColorDefaultBrush" Color="HotPink" />
20-
<SolidColorBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" Color="HotPink" />
21-
<SolidColorBrush x:Key="CardBackgroundFillColorDefaultBrush" Color="HotPink" />
22-
<SolidColorBrush x:Key="CardBackgroundFillColorSecondaryBrush" Color="HotPink" />
23-
<SolidColorBrush x:Key="CardStrokeColorDefaultBrush" Color="HotPink" />
24-
<SolidColorBrush x:Key="ControlDisplayBackgroundBrush" Color="HotPink" />
25-
<SolidColorBrush x:Key="ControlDisplayTextBrush" Color="HotPink" />
26-
<SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="HotPink" />
27-
<SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="HotPink" />
28-
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="HotPink" />
29-
<SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="HotPink" />
30-
<SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="HotPink" />
31-
<SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="HotPink" />
32-
<SolidColorBrush x:Key="ContentDialogTopOverlay" Color="HotPink" />
33-
<SolidColorBrush x:Key="AccentButtonBackground" Color="HotPink" />
34-
<SolidColorBrush x:Key="AccentButtonForeground" Color="HotPink" />
35-
<SolidColorBrush x:Key="CardBackgroundFillColorDefault" Color="HotPink" />
36-
<SolidColorBrush x:Key="ContentDialogBackground" Color="HotPink" />
37-
<SolidColorBrush x:Key="ContentDialogSmokeFill" Color="HotPink" />
38-
<SolidColorBrush x:Key="ContentDialogForeground" Color="HotPink" />
15+
<ResourceDictionary.ThemeDictionaries>
16+
<ResourceDictionary x:Key="Light">
17+
<!-- <AcrylicBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" -->
18+
<!-- TintOpacity="0.1" TintLuminosityOpacity="0.1" -->
19+
<!-- TintColor="#FF000000" FallbackColor="#20000000" /> -->
20+
21+
<SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="White" />
22+
<SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="Black" />
23+
<Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness>
24+
</ResourceDictionary>
25+
<ResourceDictionary x:Key="Dark">
26+
<!-- <AcrylicBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" -->
27+
<!-- TintOpacity="0.1" TintLuminosityOpacity="0.2" -->
28+
<!-- TintColor="#FF000000" FallbackColor="#33000000" /> -->
29+
30+
<SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="Black" />
31+
<SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="White" />
32+
<Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness>
33+
</ResourceDictionary>
34+
</ResourceDictionary.ThemeDictionaries>
3935

4036
<Color x:Key="SystemAccentColor">HotPink</Color>
4137
<GridLength x:Key="ContentDialogButtonSpacing">Auto</GridLength>
@@ -45,6 +41,14 @@
4541

4642
<fluent:SymbolIconSource Symbol="Home" x:Key="HomeIcon" />
4743
<fluent:SymbolIconSource Symbol="HomeHeart" x:Key="HomeIconFilled" />
44+
<fluent:SymbolIconSource Symbol="Settings" x:Key="SettingsIcon" />
45+
<fluent:SymbolIconSource Symbol="DocumentSettings" x:Key="SettingsIconFilled" />
46+
<fluent:SymbolIconSource Symbol="UsbPlug" x:Key="DevicesIcon" />
47+
<fluent:SymbolIconSource Symbol="PlugConnected" x:Key="DevicesIconFilled" />
48+
<fluent:SymbolIconSource Symbol="Info" x:Key="InfoIcon" />
49+
<fluent:SymbolIconSource Symbol="InfoSparkle" x:Key="InfoIconFilled" />
50+
<fluent:SymbolIconSource Symbol="PuzzlePiece" x:Key="PluginsIcon" />
51+
<fluent:SymbolIconSource Symbol="PuzzleCube" x:Key="PluginsIconFilled" />
4852

4953
<!-- -->
5054
<!-- ~1~ Other app resources here @1@ -->
@@ -90,96 +94,57 @@
9094
<!-- <Setter Property="CornerRadius" Value="4,4,0,0" /> -->
9195
<!-- <Setter Property="Padding" Value="12" /> -->
9296
<!-- <Setter Property="BorderThickness" Value="1" /> -->
93-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
97+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
9498
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorDefaultBrush}" /> -->
9599
<!-- </Style> -->
96100
<!-- -->
97101
<!-- <Style x:Key="CardMiddleStyle"> -->
98102
<!-- <Setter Property="CornerRadius" Value="0,0,0,0" /> -->
99103
<!-- <Setter Property="Padding" Value="12" /> -->
100104
<!-- <Setter Property="BorderThickness" Value="1,0,1,1" /> -->
101-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
105+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
102106
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorSecondaryBrush}" /> -->
103107
<!-- </Style> -->
104108
<!-- -->
105109
<!-- <Style x:Key="CardBottomStyle"> -->
106110
<!-- <Setter Property="CornerRadius" Value="0,0,4,4" /> -->
107111
<!-- <Setter Property="Padding" Value="12" /> -->
108112
<!-- <Setter Property="BorderThickness" Value="1,0,1,1" /> -->
109-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
113+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
110114
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorSecondaryBrush}" /> -->
111115
<!-- </Style> -->
112116
<!-- -->
113117
<!-- <Style x:Key="CardSingleStyle"> -->
114118
<!-- <Setter Property="CornerRadius" Value="4" /> -->
115119
<!-- <Setter Property="Padding" Value="12" /> -->
116120
<!-- <Setter Property="BorderThickness" Value="1" /> -->
117-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
121+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
118122
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorSecondaryBrush}" /> -->
119123
<!-- </Style> -->
120124
<!-- -->
121125
<!-- <Style x:Key="GridCardSingleStyle"> -->
122126
<!-- <Setter Property="CornerRadius" Value="4" /> -->
123127
<!-- <Setter Property="Padding" Value="12" /> -->
124128
<!-- <Setter Property="BorderThickness" Value="1" /> -->
125-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
129+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
126130
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorSecondaryBrush}" /> -->
127131
<!-- </Style> -->
128132
<!-- -->
129133
<!-- <Style x:Key="GridCardBottomStyle"> -->
130134
<!-- <Setter Property="CornerRadius" Value="0,0,4,4" /> -->
131135
<!-- <Setter Property="Padding" Value="12" /> -->
132136
<!-- <Setter Property="BorderThickness" Value="1,0,1,1" /> -->
133-
<!-- <Setter Property="BorderBrush" Value="{StaticResource CardStrokeColorDefaultBrush}" /> -->
137+
<!-- <Setter Property="BorderBrush" Value="{DynamicResource CardStrokeColorDefaultBrush}" /> -->
134138
<!-- <Setter Property="Background" Value="{StaticResource CardBackgroundFillColorSecondaryBrush}" /> -->
135139
<!-- </Style> -->
136140
<!-- -->
137-
<!-- ~1~From WinUI-Gallery@1@ -->
138-
<!-- <ResourceDictionary.ThemeDictionaries> -->
139-
<!-- <ResourceDictionary x:Key="Light"> -->
140-
<!-- ~1~ <AcrylicBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" @1@ -->
141-
<!-- ~1~ TintOpacity="0.1" TintLuminosityOpacity="0.1" @1@ -->
142-
<!-- ~1~ TintColor="#FF000000" FallbackColor="#20000000" /> @1@ -->
143-
<!-- -->
144-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="White" /> -->
145-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="Black" /> -->
146-
<!-- -->
147-
<!-- <StaticResource x:Key="ControlDisplayBackgroundBrush" -->
148-
<!-- ResourceKey="SolidBackgroundFillColorBaseBrush" /> -->
149-
<!-- <StaticResource x:Key="ControlDisplayTextBrush" ResourceKey="SystemFillColorNeutralBrush" /> -->
150-
<!-- <Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness> -->
151-
<!-- </ResourceDictionary> -->
152-
<!-- <ResourceDictionary x:Key="Dark"> -->
153-
<!-- ~1~ <AcrylicBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" @1@ -->
154-
<!-- ~1~ TintOpacity="0.1" TintLuminosityOpacity="0.2" @1@ -->
155-
<!-- ~1~ TintColor="#FF000000" FallbackColor="#33000000" /> @1@ -->
156-
<!-- -->
157-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="Black" /> -->
158-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="White" /> -->
159-
<!-- -->
160-
<!-- <StaticResource x:Key="ControlDisplayBackgroundBrush" -->
161-
<!-- ResourceKey="SolidBackgroundFillColorBaseBrush" /> -->
162-
<!-- <StaticResource x:Key="ControlDisplayTextBrush" ResourceKey="SystemFillColorNeutralBrush" /> -->
163-
<!-- <Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness> -->
164-
<!-- </ResourceDictionary> -->
165-
<!-- <ResourceDictionary x:Key="HighContrast"> -->
166-
<!-- ~1~ <AcrylicBrush x:Key="CalibrationPaneBackgroundAcrylicBrush" @1@ -->
167-
<!-- ~1~ TintOpacity="0.1" TintLuminosityOpacity="0.2" @1@ -->
168-
<!-- ~1~ TintColor="#FF000000" FallbackColor="#55000000" /> @1@ -->
169-
<!-- -->
170-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrush" Color="Black" /> -->
171-
<!-- <SolidColorBrush x:Key="NoThemeColorSolidColorBrushOpposite" Color="White" /> -->
172-
<!-- -->
173-
<!-- <SolidColorBrush x:Key="ControlDisplayBackgroundBrush" -->
174-
<!-- Color="{StaticResource SystemColorWindowColor}" /> -->
175-
<!-- <SolidColorBrush x:Key="ControlDisplayTextBrush" Color="{StaticResource SystemColorWindowTextColor}" /> -->
176-
<!-- <Thickness x:Key="ControlExampleDisplayBorderThickness">1</Thickness> -->
177-
<!-- </ResourceDictionary> -->
178-
<!-- </ResourceDictionary.ThemeDictionaries> -->
179141
</ResourceDictionary>
180142
</Application.Resources>
181143

182144
<Application.Styles>
183145
<sty:FluentAvaloniaTheme PreferSystemTheme="True" PreferUserAccentColor="True" />
146+
<Style Selector=":is(TopLevel)">
147+
<Setter Property="FontFamily" Value="Segoe UI"/>
148+
</Style>
184149
</Application.Styles>
185150
</Application>

Amethyst/App.axaml.cs

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Avalonia.Controls;
1616
using Avalonia.Controls.ApplicationLifetimes;
1717
using Avalonia.Markup.Xaml;
18+
using Avalonia.Media;
1819
using Avalonia.Platform.Storage;
1920
using Avalonia.Styling;
2021
using Avalonia.Threading;
@@ -169,17 +170,30 @@ public override void OnFrameworkInitializationCompleted()
169170
switch (ApplicationLifetime)
170171
{
171172
case ISingleViewApplicationLifetime singleView:
172-
singleView.MainView = new UserControl
173-
{
174-
Content = "Why?"
175-
};
173+
singleView.MainView = new UserControl { Content = "Why?" };
176174
break;
177175
case IClassicDesktopStyleApplicationLifetime desktop:
178176
{
179-
desktop.MainWindow = new MainWindow { Width = 1000, Height = 700 };
177+
desktop.MainWindow = new Window()
178+
{
179+
Content = new Grid()
180+
{
181+
Background = new SolidColorBrush(Colors.Red),
182+
Children =
183+
{
184+
new TextBlock()
185+
{
186+
Text = "Why?",
187+
HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center,
188+
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center,
189+
Foreground = Brushes.White
190+
}
191+
}
192+
}
193+
};
180194

181195
Shared.Main.Window = desktop.MainWindow;
182-
196+
183197
SetupCoreApplication();
184198
var args = desktop.Args;
185199

@@ -973,14 +987,26 @@ await Interfacing.ExecuteAppRestart(admin: true, filenameOverride: "powershell.e
973987
return; // That's all!
974988
}
975989

976-
Logger.Info("Creating a new MainWindow view...");
977-
_mWindow = new MainWindow(); // Create a new window
990+
Logger.Info("Updating the MainWindow view...");
991+
992+
try
993+
{
994+
_mWindow = new MainWindow(); // Create a new window
995+
}
996+
catch (Exception ex)
997+
{
998+
Debug.WriteLine(ex);
999+
throw;
1000+
}
1001+
1002+
desktop.MainWindow = _mWindow;
1003+
Shared.Main.Window = _mWindow;
9781004

9791005
Logger.Info($"Activating {_mWindow.GetType()}...");
9801006
_mWindow.Activate(); // Activate the main window
9811007

9821008
// Check for any additional work
983-
if (!_hostViews.Any()) return;
1009+
if (_hostViews.Count is 0) return;
9841010

9851011
Logger.Info($"Waiting for {_mWindow.GetType()} to show up...");
9861012
await Task.Delay(1000); // Assume this will be enough

0 commit comments

Comments
 (0)