Browse Source

Fix default WindowBackdrop setting

pull/5/head
JT 1 year ago
parent
commit
e0ab352d02
  1. 2
      StabilityMatrix/Models/Settings.cs
  2. 9
      StabilityMatrix/StabilityMatrix.csproj
  3. 2
      StabilityMatrix/ViewModels/InstallerViewModel.cs
  4. 6
      StabilityMatrix/ViewModels/MainWindowViewModel.cs
  5. 2
      StabilityMatrix/ViewModels/SettingsViewModel.cs

2
StabilityMatrix/Models/Settings.cs

@ -7,7 +7,7 @@ namespace StabilityMatrix.Models;
public class Settings
{
public string? Theme { get; set; }
public WindowBackdropType WindowBackdropType { get; set; }
public WindowBackdropType? WindowBackdropType { get; set; }
public List<InstalledPackage> InstalledPackages { get; set; } = new();
public Guid? ActiveInstalledPackage { get; set; }
public bool IsNavExpanded { get; set; }

9
StabilityMatrix/StabilityMatrix.csproj

@ -9,6 +9,7 @@
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<ApplicationIcon>Assets\Icon.ico</ApplicationIcon>
<LangVersion>11</LangVersion>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<ItemGroup>
@ -48,7 +49,6 @@
<Content Include="Assets\Icon.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="Assets\Git-2.40.1-64-bit.exe" />
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@ -89,8 +89,9 @@
</Page>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy $(Pkg7-Zip_CommandLine)\tools\x64\7za.exe $(OutDir)\Assets\" />
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command="if not exist $(PublishDir)\Assets mkdir $(PublishDir)\Assets" />
<Exec Command="copy $(Pkg7-Zip_CommandLine)\tools\x64\7za.exe $(PublishDir)\Assets\" />
</Target>
</Project>

2
StabilityMatrix/ViewModels/InstallerViewModel.cs

@ -93,7 +93,7 @@ public partial class InstallerViewModel : ObservableObject
private bool showDuplicateWarning;
public WindowBackdropType WindowBackdropType => settingsManager.Settings.WindowBackdropType;
public WindowBackdropType WindowBackdropType => settingsManager.Settings.WindowBackdropType ?? Wpf.Ui.Controls.Window.WindowBackdropType.Mica;
public Visibility ProgressBarVisibility => ProgressValue > 0 || IsIndeterminate ? Visibility.Visible : Visibility.Collapsed;
public string ReleaseLabelText => IsReleaseMode ? "Version" : "Branch";

6
StabilityMatrix/ViewModels/MainWindowViewModel.cs

@ -94,17 +94,17 @@ public partial class MainWindowViewModel : ObservableObject
if (Application.Current.MainWindow != null)
{
WindowBackdrop.ApplyBackdrop(Application.Current.MainWindow,
settingsManager.Settings.WindowBackdropType);
settingsManager.Settings.WindowBackdropType ?? WindowBackdropType.Mica);
}
var theme = settingsManager.Settings.Theme;
switch (theme)
{
case "Dark":
Theme.Apply(ThemeType.Dark, settingsManager.Settings.WindowBackdropType);
Theme.Apply(ThemeType.Dark, settingsManager.Settings.WindowBackdropType ?? WindowBackdropType.Mica);
break;
case "Light":
Theme.Apply(ThemeType.Light, settingsManager.Settings.WindowBackdropType);
Theme.Apply(ThemeType.Light, settingsManager.Settings.WindowBackdropType ?? WindowBackdropType.Mica);
break;
}
});

2
StabilityMatrix/ViewModels/SettingsViewModel.cs

@ -57,7 +57,7 @@ public partial class SettingsViewModel : ObservableObject
this.a3WebApi = a3WebApi;
this.pyRunner = pyRunner;
SelectedTheme = settingsManager.Settings.Theme ?? "Dark";
WindowBackdropType = settingsManager.Settings.WindowBackdropType;
WindowBackdropType = settingsManager.Settings.WindowBackdropType ?? WindowBackdropType.Mica;
}
[ObservableProperty]

Loading…
Cancel
Save