Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theming for powertoys run #4007

Merged
merged 9 commits into from
Jun 5, 2020
Merged

Conversation

dsrivastavv
Copy link
Contributor

@dsrivastavv dsrivastavv commented Jun 3, 2020

Summary of the Pull Request

Added support for light, dark and high contrast themes in PowerToys run

References

  1. https://mahapps.com/docs/themes/thememanager

PR Checklist

Detailed Description of the Pull Request / Additional comments

  1. Added Theme Manager for PowerToys Run using theming interface for Mahapps
  2. Added dark, light and high contrast theme
  3. Removed themes inherited from Wox

Validation Steps Performed

Manually validated that theme is changed when toggled between dark, light, high contrast 1, high contrast 2, high contrast black and high contrast white modes.

Know Issues

  1. When theme is changed, previously applied theme flashes and then the new theme is applied.
  2. Currently, all high contrast themes only have dummy values.

Dark Theme

dark

High contrastTheme

HC

LightTheme

Light

@dsrivastavv dsrivastavv requested review from niels9001 and a team June 3, 2020 00:25
@crutkas
Copy link
Member

crutkas commented Jun 3, 2020

Think we will need some TLC on high contrast but awesome!

Copy link
Contributor

@niels9001 niels9001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed with @crutkas - I think we need to atleast change the hover visual to purple/green.

I realized that Windows provides different contrast themes. Which one do we support? What is part of this PR is I similar to HighContrast White.

image

@dsrivastavv
Copy link
Contributor Author

@niels9001 I have found a way in which we handle all the four types of contrast separately. I will push the changes and let you know.

@dsrivastavv dsrivastavv added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Jun 3, 2020
@@ -787,7 +787,7 @@
<Fragment>
<ComponentGroup Id="LauncherComponents">
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
<?foreach File in concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;EntityFramework.SqlServer.dll;EntityFramework.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;NHotkey.dll;NHotkey.Wpf.dll;NLog.dll;NLog.Extensions.Logging.dll;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;sni.dll;System.Data.SQLite.EF6.dll;PowerLauncher.runtimeconfig.json;SQLite.Interop.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll?>
<?foreach File in concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;EntityFramework.SqlServer.dll;EntityFramework.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;NHotkey.dll;NHotkey.Wpf.dll;NLog.dll;NLog.Extensions.Logging.dll;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;sni.dll;System.Data.SQLite.EF6.dll;PowerLauncher.runtimeconfig.json;SQLite.Interop.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;MahApps.Metro.dll?>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the following dll's at the end: ControlzEx.dll, MahApps.Metro.dll

@niels9001
Copy link
Contributor

@niels9001 I have found a way in which we handle all the four types of contrast separately. I will push the changes and let you know.

That'd be great! Once that's in I'll make sure to update all the high contrast themes right colors.

@dsrivastavv
Copy link
Contributor Author

@niels9001 I have found a way in which we handle all the four types of contrast separately. I will push the changes and let you know.

That'd be great! Once that's in I'll make sure to update all the high contrast themes right colors.

Sound good! Thanks a lot, Niels 😄

Copy link
Contributor

@alekhyareddy28 alekhyareddy28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the accent colors changing in PT Run when I change the windows accent. Is that expected behavior? Personally I would like my accent colors to be the same as that of windows. Doesn't have to be a part of this PR if we choose to go ahead with it.

nit: Can you pls update the reference link in the Summary of this PR to https://mahapps.com/docs/themes/thememanager, it shows a 404 when I click on the present link.

@crutkas
Copy link
Member

crutkas commented Jun 5, 2020

I don't see the accent colors changing in PT Run when I change the windows accent. Is that expected behavior? Personally I would like my accent colors to be the same as that of windows. Doesn't have to be a part of this PR if we choose to go ahead with it.

Let’s log a new bug for that with what accent isn’t correct.

@niels9001
Copy link
Contributor

I think WPF requires you to restart the app for the Accebt brush update. I recall we had something like that in the Fancy Zones editor as well.

@AnuthaDev
Copy link

For updating accent color, #2988 might help😊

@dsrivastavv
Copy link
Contributor Author

@alekhyareddy28 Updating with accent color wasn't in the scope of this PR. We used controlzex to register a callback for theme change but it doesn't fire a callback on accent changes and only on light/dark base color changes. Also as Niels pointed out, if we use Mahapps accent brushes they would require system to be restarted before the changes can take effect. I will file a bug for accent color so we can track this.

@dsrivastavv
Copy link
Contributor Author

dsrivastavv commented Jun 5, 2020

@AnuthaDev Correct me if I am wrong but your changes in #2988 would only be applied on launcher startup and not on accent changes at runtime?

@AnuthaDev
Copy link

@AnuthaDev Correct me if I am wrong but your changes in #2998 would only be applied on launcher startup and not on accent changes at runtime?

Everytime the visibility of launcher is changed, i.e. whenever you launch it using alt+space

@AnuthaDev
Copy link

Its a simple solution, whenever the launcher visibility changes, query and set the accentcolor

@AnuthaDev
Copy link

Something like this would have greatly simplified the code, but afaik its uwp only:

https://docs.microsoft.com/en-us/windows/uwp/data-binding/function-bindings

@dsrivastavv
Copy link
Contributor Author

@AnuthaDev Correct me if I am wrong but your changes in #2998 would only be applied on launcher startup and not on accent changes at runtime?

Everytime the visibility of launcher is changed, i.e. whenever you launch it using alt+spac

Its a simple solution, whenever the launcher visibility changes, query and set the accentcolor

@AnuthaDev I have created an issue for this. Let's move this discussion to #4107.

@dsrivastavv dsrivastavv merged commit 6adb47c into microsoft:master Jun 5, 2020
@AnuthaDev
Copy link

@somil55 Bro you disabled cleartype with this🙄. Don't change the opacity of colors to change the color value. The alpha channel should always be FF.

@dsrivastavv
Copy link
Contributor Author

@AnuthaDev Please look at #4119 for any color-related settings for this PR.

@dsrivastavv dsrivastavv mentioned this pull request Sep 28, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants