move theme helper ref

This commit is contained in:
Paddy
2022-02-20 18:54:51 +01:00
parent fc14b58fa5
commit c93be2cb51
4 changed files with 5 additions and 46 deletions

View File

@@ -1,41 +0,0 @@
// Copyright © 2019 Paddy Xu
//
// This file is part of QuickLook program.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using Microsoft.Win32;
namespace QuickLook.Helpers
{
internal class OSThemeHelper
{
public static bool AppsUseDarkTheme()
{
var value = Registry.GetValue(
@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize",
"AppsUseLightTheme", 1);
return value != null && (int)value == 0;
}
public static bool SystemUsesDarkTheme()
{
var value = Registry.GetValue(
@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize",
"SystemUsesLightTheme", 0);
return value == null || (int)value == 0;
}
}
}

View File

@@ -104,13 +104,13 @@
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="windows">
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0\Facade\windows.winmd</HintPath>
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0\Facade\windows.winmd</HintPath>
</Reference>
<Reference Include="Windows.Foundation.FoundationContract">
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\References\10.0.19041.0\Windows.Foundation.FoundationContract\4.0.0.0\Windows.Foundation.FoundationContract.winmd</HintPath>
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.FoundationContract\3.0.0.0\Windows.Foundation.FoundationContract.winmd</HintPath>
</Reference>
<Reference Include="Windows.Foundation.UniversalApiContract">
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\References\10.0.19041.0\Windows.Foundation.UniversalApiContract\10.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
<HintPath>$(SystemRoot)\..\Program Files (x86)\Windows Kits\10\References\10.0.17763.0\Windows.Foundation.UniversalApiContract\7.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
@@ -143,7 +143,6 @@
<Compile Include="Controls\BusyDecorator\BackgroundVisualHost.cs" />
<Compile Include="Controls\BusyDecorator\BusyDecorator.cs" />
<Compile Include="Controls\BusyDecorator\VisualTargetPresentationSource.cs" />
<Compile Include="Helpers\OSThemeHelper.cs" />
<Compile Include="Helpers\ShareHelper.cs" />
<Compile Include="Helpers\SystemHelper.cs" />
<Compile Include="NativeMethods\ShellLink.cs" />

View File

@@ -20,6 +20,7 @@ using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using QuickLook.Common.Annotations;
using QuickLook.Common.Helpers;
using QuickLook.Common.Plugin;
using QuickLook.Helpers;