Skip to content

Use accent color as the default color for controls #3775

Open

Description

@jgkumaran

Related to microsoft/WindowsAppSDK#232

Today WPF uses Blue as the default colour instead of the user's accent colour. This is the same for WinForms too but since it's GDI based it can be tweaked easily but WPF controls are rendered independently so it needs internal modification for WPF. Please start using the accent colour on Windows 10 for a consistent user experience.

Activity

  1. miloush commented on Nov 6, 2020

    @miloush
    Contributor

    Do you mean for hyperlinks?

    Like WinForms, WPF uses the system color setting (i.e. COLOR_HOTLIGHT via SystemColors.HotTrackBrushKey) for hyperlinks, unless, for some reason, they are in a RichTextBox.

    I agree that the accent color (and brush and corresponding dynamic keys) should be available through SystemColors regardless of any theming.

    However, unless your app is using the whole system theme then it does not make any sense to take out the hyperlink color (e.g. white) and apply it to an app that has different colors (e.g. white background).

    For full Windows 10 WPF theme that would presumably use the accent colour for hyperlinks and elsewhere as appropriate, see #1485.

  2. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @miloush For everything like list view selection, button click, borders just like WinUI. The problem is these methods return GDI theming and new Windows Runtime theming. You can use Windows.UI.ViewManagement.UISettings.GetColorValue() to get the modern colours defined in Settings personalization.

  3. miloush commented on Nov 6, 2020

    @miloush
    Contributor

    You said WPF uses Blue, but unless I missed something, that is not true for list view selection, button click and borders.

    Looks like you are looking for full theme then, in which case this would be duplicate of #1485.

  4. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @miloush No, I'm looking for the colour. It doesn't follow the modern Windows colour set in Settings and instead uses the old colour palette which is hidden in Windows 10.

  5. mdtauk commented on Nov 6, 2020

    @mdtauk

    It would be nice if in the future as well as updating the WPF control themes to better match WinUI and FluentUI - that through some new Reunion API, the Accent Color, Light and Dark theme resources could apply to WPF. Including redrawing the windows as the theme updates.

  6. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @mdtauk That can be done but I want WPF to follow modern system colours. It is not a WinUI only thing and can be accessed in any application and with Windows.UI.ViewManagement.UISettings.GetColorValue()

  7. miloush commented on Nov 6, 2020

    @miloush
    Contributor

    @Jaiganeshkumaran In WPF, colours for controls are supplied by themes that contain control styles. The issue I referenced already expressed the team's intent to provide what you are asking for. If you disagree, explain how your request is different.

  8. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @miloush I disagree because #1485 is telling about inline style with Winforms which also uses the old colour scheme instead of WinRT accent. This is about adopting the new colour scheme set in Settings app

  9. mdtauk commented on Nov 6, 2020

    @mdtauk

    @Jaiganeshkumaran In WPF, colours for controls are supplied by themes that contain control styles. The issue I referenced already expressed the team's intent to provide what you are asking for. If you disagree, explain how your request is different.

    There is a difference between the System Colors which are provided by the Win32 APIs and MSStyles

    image

    And the Modern WinUI colour resources provided by the Light and Dark modes, and the user's chosen Accent Color.

    image

  10. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @mdtauk Actually the modern colours are not actually part of WinUI. They are stored separately but Windows.UI.ViewManagement.UISettings.GetColorValue() can be called in non WinUI apps as well.

  11. miloush commented on Nov 6, 2020

    @miloush
    Contributor

    I am aware of the difference. #1485 (comment) specifically says, requoting

    The WinUI team, which now owns WPF, said in the July Community Call that they plan to update the WPF styles for Fluent Design.

    How is this different from what is being asked here?

  12. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    I didn't ask for styles only the colour but that can be part of it. However many so-called "Fluent" apps like Microsoft Edge don't follow the same colour scheme so I will keep it open.

  13. miloush commented on Nov 6, 2020

    @miloush
    Contributor

    The color is defined in styles. I am obviously failing to get the point across so I will leave it for others to try.

  14. mdtauk commented on Nov 6, 2020

    @mdtauk

    I didn't ask for styles only the color but that can be part of it. However many so called "Fluent" apps like MS edge don't follow the same color scheme so I will keep it open.

    Edge is not WPF nor WinUI.

    Fluent Design would require a new Default Theme for WPF (styled to match WinUI and FluentUI control templates and theme colours) as well as Light and Dark mode support, as well as High Contrast themes.

    It would also require a WPF API that can use and apply the user's chosen Accent Color.

    Of course this would only apply to the control templates when the WPF app is running on a supported Windows 10 version.

  15. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @mdtauk As a user, when I change the colour from Windows Settings, I expect that all native apps follow it. A user doesn't know the difference between UWP XAML and WPF XAML and non-XAML UI. Third-party apps that synchronise the accent colour from desktop to modern exists but why can't Microsoft do that with Windows? Since WPF is open-source I just asked to follow my accent colour and not use the old stuff.

  16. jgkumaran commented on Nov 6, 2020

    @jgkumaran
    Author

    @miloush Those values don't use the modern colouring system instead using the GDI colour which has no customization UI anymore to push apps to UWP.

  17. mdtauk commented on Nov 6, 2020

    @mdtauk

    @mdtauk As a user, when I change the colour from Windows Settings, I expect that all native apps follow it. A user doesn't know the difference between UWP XAML and WPF XAML and non-XAML UI. Third-party apps that synchronise the accent colour from desktop to modern exists but why can't Microsoft do that with Windows? Since WPF is open-source I just asked to follow my accent color and not use the old stuff.

    I hear ya, I am asking for changes to the default system theme for WPF apps on Windows 10.

  18. ShankarBUS commented on Nov 7, 2020

    @ShankarBUS

    Guys, don't get me wrong but WPF is put to maintenance mode.

    No new controls or features.

    They won't be listening to us.
    Even WinForms had some striking changes after being opensourced. But WPF?

    They don't want to invest in WPF anymore. Our only options are either switch to WinUI or use 3rd libs.

    You are wasting your time and energy arguing with them.
    I lost my hope that WPF will be actively improved once it's open source.

    Even I and another guy proposed some features such as hard edge gaussian blur and smooth scrolling as in UWP.
    They didn't even respond!

    You thing they would do high workload tasks like this?

    This would require heavy work, testing and synchronization with WinUI team. Which they won't do.

    That's it folks, continue your conversation!

  19. jgkumaran commented on Nov 7, 2020

    @jgkumaran
    Author

    @ShankarBUS I don't develop WPF apps any more so I don't care if it's maintained or not but WPF apps on Windows 10 must follow things like the accent colour, dark mode etc... to make Windows consistent.

  20. ShankarBUS commented on Nov 7, 2020

    @ShankarBUS

    Did you even read my comment fully?

    They don't care about adding new features to WPF!!!! (Or WPF in general)

    It's left to die silently!

    They will just ignore this issue and move this to their backlog!
    I saw past WinUI community calls, the team would just go by the roadmap they planned.

    This issue will be one of the other backlogged issue 😢.

    to make Windows consistent.

    It's up to the developer! If dev don't care why would MS?

    They provide the tools elsewhere, stop asking them everything!

    There are community driven projects that do their job.

    As a WPF dev, I use a 3rd party lib (open source - ModernWpf) to make my app (ModernFlyouts) consistent with Windows!

    Any developer can do it iff they have the intent!

    TL;DR

    "WPF is dead, move on to WinUI"
    This is what MS thinks.
    So no new features!

  21. jgkumaran commented on Nov 7, 2020

    @jgkumaran
    Author

    @ShankarBUS Remember Visual Studio is still WPF and not WinUI. It's not an active technology but many applications still rely on WPF.

  22. ShankarBUS commented on Nov 7, 2020

    @ShankarBUS

    So, let's even if they "add" this feature to WPF.

    It would only be available on newer .NET releases post .NET 5.

    So the app developer still need to migrate their app to the "newer" .NET.

    The WPF team would make a half-ass implementation of the "new" theme support, styles.

    It would be so fragmented!

    It just takes like <1 hr to switch to third party libs (such as MahApps or ModernWpf) to get a full proper WinUI like app!

    (I'm not advocating for any of the mentioned libraries, just stating the obvious)

    It's the developer's mistake not keeping their app consistent with Windows when there are easier ways to did it. Why only relying on MS, when the open source community has better options for the requested feature????

    The WPF team would take ages to do this! They'll only add it to .NET 6 (if they even care a little bit about the community).

  23. added
    Enhancement Requested
    on Nov 13, 2020
  24. added this to the Future milestone on Nov 13, 2020
  25. jmelas commented on Mar 7, 2022

    @jmelas

    It seems to me that this request boils down to these changes:

    • GetSysColor(COLOR_HIGHLIGHT) should return the AccentColor
    • GetSysColor(MENU_HIGHLIGHT) should return the new Gray Color that WinUI uses. I am on Windows 11 22567 and I am happy that Win32 Menus already use the new Gray Color when hovering Menu Items.
    • All Win32 Controls that use COLOR_HIGHLIGHT should be painted with the AccentColor. This includes EditBox, ListView, TreeView etc.
    • Visual Styles (OpenThemeData API) should not provide images but they should be composable on the fly using the Accent Color. I am afraid this is the most tricky part.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement Requested

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions