Skip to content

Commit

Permalink
Allow to disable accent colorized background on .1618+
Browse files Browse the repository at this point in the history
Also disables acrylic effect

#25
  • Loading branch information
krlvm committed Apr 23, 2022
1 parent a7480fd commit 6f7e0e3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
8 changes: 7 additions & 1 deletion BeautySearch/BeautySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const SETTINGS_DEFAULTS = {
topAppsCardsOutline: false, // true | false
hideOutlines: true, // true | false
acrylicMode: false, // true | false | 'fake'
backgroundMode: true, // true | false | 'system' | color: String
backgroundMode: true, // true | false | 'system' | 'dark2022' | color: String
enhancedAcrylic: true, // true | false
corners: 'sharp', // 'default' | 'sharp' | 'round'
theme: 'auto', // 'auto' | 'light' | 'dark'
Expand Down Expand Up @@ -724,6 +724,12 @@ if(SETTINGS.backgroundMode) {
}
`);
}
} else if (SETTINGS.backgroundMode == 'dark2022') {
injectStyle(`
.${DEF_DARK} {
background: #1f1f1f !important;
}
`);
} else {
injectStyle(`
#rootContainer {
Expand Down
5 changes: 5 additions & 0 deletions BeautySearch/Installer/ScriptInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public static int Install(FeatureControl features)
{
target = target.Replace(Get20H1FTimeout(TIMEOUT_20H1F_CUSTOM), Get20H1FTimeout(TIMEOUT_20H1F_DEFAULT));
}

if (!features.IsEnabled("backgroundMode"))
{
features.Set("backgroundMode", "dark2022");
}
}

//target = ToggleEntrypointFeature(target, "enableTwoPanesZI", !features.IsEnabled("disableTwoPanel"));
Expand Down
22 changes: 11 additions & 11 deletions BeautySearch/UI/InstallationForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions BeautySearch/UI/InstallationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ private void InstallationForm_Load(object sender, EventArgs e)

private void EnumerateFeatures()
{
bool ver2022 = ScriptInstaller.is20H1Fixed();
bool acrylicEnabled = Utility.IsPersonalizationFeatureEnabled("EnableTransparency");

if (!ScriptInstaller.is20H1() || !ScriptInstaller.is20H1Fixed())
{
AddFeature("Show accent color on Search Window", "backgroundMode", Utility.IsPersonalizationFeatureEnabled("ColorPrevalence"));
}
AddFeature("Enable Acrylic" + (!ScriptInstaller.is20H1Fixed() ? " (or Fake Acrylic on 20H1+)" : ""), "acrylicMode", acrylicEnabled);
AddFeature("Enable Acrylic" + (!ver2022 ? " (or Fake Acrylic on 20H1+)" : ""), "acrylicMode", acrylicEnabled);
AddFeature("Enhanced design with more Acrylic", "enhancedAcrylic", true);
AddFeature("Show accent color on Search Window" + (ScriptInstaller.is20H1() && ver2022 ? " when it is shown on Start" : ""), "backgroundMode", (ScriptInstaller.is20H1() && ver2022) || Utility.IsPersonalizationFeatureEnabled("ColorPrevalence"));
AddFeature("Remove background from UWP application icons", "disableTilesBackground", ScriptInstaller.CURRENT_BUILD >= ScriptInstaller.BUILD_20H1+1);
AddFeature("Fluent Context Menu", "contextMenuFluent");
AddFeature("Acrylic Context Menu", "contextMenuAcrylic", acrylicEnabled);
Expand All @@ -57,7 +55,7 @@ private void EnumerateFeatures()
{
AddFeature("[19H2+] Improve Explorer Search look (for 125% DPI Scaling)", "explorerSearchFixes", Utility.GetDPIScaling() == 120);
}
if (!ScriptInstaller.is20H1Fixed())
if (!ver2022)
{
AddFeature("[20H1+] Capture desktop to apply Fake Acrylic", "fakeAcrylicDesktopCrop", false);
AddFeature("[20H1+] Don't override Fake Acrylic wallpaper for now", "skipFakeAcrylic", false);
Expand Down

0 comments on commit 6f7e0e3

Please sign in to comment.