winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Epic - Align with Win11 look and feel

Open merriemcgaw opened this issue 3 years ago • 13 comments

Windows 11 implemented a new look and feel. While we get most of that automatically through the Common Controls we do have several places where we owner draw our controls and these should be enhanced in some way to look more aligned with Windows. This is part of our dotnet/planning/issues/27 theme.

I will be creating and adding issues to this epic in the coming weeks to outline precisely what we need to be doing.

  • [ ] Investigate which controls need to be changed to align with Win11
  • [ ] If available from Windows, expose a property that indicates whether the OS is in a Dark Mode or a Light Mode. I'm currently working directly with Windows on this.
  • [ ] https://github.com/dotnet/winforms/issues/7641
  • [x] #6153
  • [x] #5516
  • [x] #6187

merriemcgaw avatar Dec 04 '21 01:12 merriemcgaw

#3691? 😌

kirsan31 avatar Dec 04 '21 08:12 kirsan31

@merriemcgaw is there plans to have it auto select dark mode for everything if Windows is in Dark mode (to color everything including scrollbars dark like in Windows Explorer).

Bonus Points: If the Windows Team can expose a way to make all MessageBoxes/TaskDialogs, as well as all of the Common Controls dark as well too.

Although it would be cool if there was apis where an application can create it's own Themes (that SetWindowTheme can be called with) that only can be used by the application that "registers" that theme only during the lifetime of the application. This is so users can basically provide their own visual styles and Windows would use them without them needing to change any of their code or needing to dig into undocumented window messages, etc just to override certain things.

An example is an application with multiple icons where say, icon 1 is purple (which makes the application needing to be themed entirely in purple colors), icon 2 is pink (which makes the application needing to be themed entirely in pink colors), or light/dark to match the OS when an icon is not selected.

AraHaan avatar Dec 14 '21 07:12 AraHaan

Our plans are in the very early stages @AraHaan. I'm working with Windows to make sure an API is available that exposes to WinForms whether the OS is set to light theme or dark theme. We'd obviously expose this in WinForms APIs as quickly as we can. But going as far as a full automatic theme, I can't predict a timeline for that. We've got some ideas but there's also issue prioritization and resourcing to consider.

If anyone has specific API suggestions or ideas around this we are excited to see them😄.

merriemcgaw avatar Dec 17 '21 00:12 merriemcgaw

I guess a possible winapi header for it could look like so:

WINAPI BOOL IsSystemLightThemeMode(); /* For getting if the OS is in light mode or dark mode. */
/* a special version of all of the MessageBox and TaskDialog apis that
adds BOOL lightMode as a parameter (and have the original basically stub
into it with it set to true to avoid code duplication on the implementation level). */

Oh course that would need to be done on the Windows sides and more work might need to be done to allow it for basically all of the common controls apis, etc.

AraHaan avatar Dec 17 '21 03:12 AraHaan

image Do you know how sad this made me... I... I'll stop programming...

AuracleTech avatar Jan 04 '22 01:01 AuracleTech

This is a Windows issue, a pure MFC app will look the same.

RussKie avatar Jan 04 '22 13:01 RussKie

@RussKie is correct. We're going to revisit this issue again with Windows. The concept of MDI apps is not something Windows is recommending as an approach to UI design, so getting them to make a change like this is pretty difficult.

merriemcgaw avatar Jan 05 '22 19:01 merriemcgaw

@RussKie

This is a Windows issue, a pure MFC app will look the same.

https://user-images.githubusercontent.com/12494184/148296043-48b700b7-3164-4c04-b98d-baf4e8f39d6d.mp4

May be but it's beautiful to draw it. paint Non Client area not easy for all. make Chrome window for mdi ,Child ,normal Window is required if asp.net core didn't do it who will do

memoarfaa avatar Jan 05 '22 22:01 memoarfaa

@merriemcgaw

@RussKie is correct. We're going to revisit this issue again with Windows. The concept of MDI apps is not something Windows is recommending as an approach to UI design, so getting them to make a change like this is pretty difficult.

Windows fix will not be good issue but custom NC area WndProc theme messages will be

memoarfaa avatar Jan 05 '22 22:01 memoarfaa

If you have a fix in mind, please feel free to open a draft PR to continue the discussion.

RussKie avatar Jan 05 '22 22:01 RussKie

If you have a fix in mind, please feel free to open a draft PR to continue the discussion.

you already see the fix but there is some of points need to discuss how to introduce it. I will open discussion

memoarfaa avatar Jan 06 '22 00:01 memoarfaa

@memoarfaa

you already see the fix but there is some of points need to discuss how to introduce it. I will open discussion

You can use existing one.

kirsan31 avatar Jan 06 '22 03:01 kirsan31

Take a look at this: #10985

KlausLoeffelmann avatar Mar 06 '24 19:03 KlausLoeffelmann