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

System Icon turn gray when app inactive #2547

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Conversation

lededev
Copy link
Contributor

@lededev lededev commented Nov 18, 2024

image
Visual Studio 2022 have this feature, may usable when enable 'Use custom system color'.

@lededev
Copy link
Contributor Author

lededev commented Nov 18, 2024

I find another problem when enable 'Use custom system color', and set Color Scheme to 'Solarized Dark', title bar background is not apply 3Dface.

@sdottaka
Copy link
Member

Thanks for the PR...
But most applications don't gray their icons when inactive. Is this important?

My concern with this is the increased size of the executable due to the icon. I want to keep WinMerge as small and fast to start as possible. (I don't think this PR will actually change the behavior much, but I want to avoid this kind of stuff accumulating.)

Is it possible to dynamically grayscale the icon instead of adding an icon?

@lededev
Copy link
Contributor Author

lededev commented Nov 19, 2024

I've changed to lazy loading icon to improve the program startup speed, and the grayscale icon to calculate generation, removed Merge_gray.ico from resouce.

@lededev
Copy link
Contributor Author

lededev commented Nov 19, 2024

Thanks for the PR... But most applications don't gray their icons when inactive. Is this important?

When the interface uses a completely black skin and multiple instances are on different monitors or far apart, it is a bit difficult to determine which instance has the focus. At this time, it is faster to observe whether the system icon in the upper left corner is orange color.

I need to compare 9 files across at least 3 instances, which is why clear focus visibility in a program is crucial for me.

Of course, this is mainly a suitable interface that uses COLOR_3DFACE for the background color of the title bar, mainly the dark color scheme. I myself use the configuration of the light color scheme AccentColor on a daily basis.

@sdottaka sdottaka merged commit 0e1d4f4 into WinMerge:master Nov 19, 2024
3 checks passed
@sdottaka
Copy link
Member

Thank you for the explanation.

I have merged this PR.

I will also make the following changes:

  • Delete the icon in the destructor of CTitleBarHelper

  • Lazy load the gray icon so that it does not need to be created until the application is inactive

sdottaka added a commit that referenced this pull request Nov 19, 2024
-    Delete the icon in the destructor of CTitleBarHelper
-    Lazy load the gray icon so that it does not need to be created until the application is inactive
@sdottaka sdottaka added this to the v2.16.45.0 milestone Nov 19, 2024
@lededev
Copy link
Contributor Author

lededev commented Nov 19, 2024

I located the switch, but since I haven't used the English version of Windows 11, I can't link it to colorPrevalence. However, it seems overly restrictive to change system settings just to enable title bar skin. Wouldn't it be simpler to allow 'Use custom system color' for this purpose? Other applications with custom title bars don't impose such limitations.
image

@sdottaka
Copy link
Member

I can't link it to colorPrevalence.

When "在标题栏和窗口边框上显示强调色" is turned on, I thought that HKCU\Software\Microsoft\Windows\DWM\ColorPrevelance would be set to 1, but does this actually not happen?

image

@sdottaka
Copy link
Member

Other applications with custom title bars don't impose such limitations.
Edge respects the "Show accent color on title bars and window borders" setting.

@lededev
Copy link
Contributor Author

lededev commented Nov 20, 2024

When "在标题栏和窗口边框上显示强调色" is turned on, I thought that HKCU\Software\Microsoft\Windows\DWM\ColorPrevelance would be set to 1, but does this actually not happen?

I hadn't initially linked colorPrevalence with "在标题栏和窗口边框上显示强调色," but after reading some documentation, I realized the connection.

Edge respects the "Show accent color on title bars and window borders" setting.

Some users might prefer to retain the original colorPrevalence look in Edge while trying the WinMerge dark theme. Requiring system-wide changes for this feels too restrictive.

@lededev
Copy link
Contributor Author

lededev commented Nov 20, 2024

Perhaps making changes to the default system behavior in a new version might lead to user pushback and resistance.
However, providing an optional, user-defined switch allows users to feel they have made the choice themselves.
This approach seems sufficient, without the need to alter the entire system settings, which might impact other programs unfavorably.

@lededev
Copy link
Contributor Author

lededev commented Nov 20, 2024

How about adding a checkbox option labeled 'Title Bar Using 3DFace'? This way, whether using accent color or 3DFace, both can utilize the user's custom system color.
When select 'Midnight' or 'Solarized Dark' scheme, default enabling the checkbox by a secheme config value, make it easy to config.
image

@lededev
Copy link
Contributor Author

lededev commented Nov 21, 2024

Microsoft Edge doesn't need to disable colorPrevalence when switching to a user custom scheme.
image

@sdottaka
Copy link
Member

What you want to achieve is to be able to change the title color without disabling colorPrevalence, correct?

@lededev
Copy link
Contributor Author

lededev commented Nov 21, 2024

Yes, the difference lies in the parameters used to draw the title bar's background and foreground colors. I hope both methods can benefit from the user-custom system colors feature. Therefore, adding a checkbox is a win-win solution.

@lededev
Copy link
Contributor Author

lededev commented Nov 21, 2024

Another approach is to append Settings/Title3DFace=1 to the ColorSchemes/Midnight.ini config line:

Settings/WordDifferenceDeletedColor=0xde000d
Settings/WordDifferenceTextColor=0xffffffff
Settings/SysColorHookEnabled=1
Settings/Title3DFace=1

This defines the scheme to prefer using 3DFace color for drawing the title bar. If adding a checkbox to the settings feels too complex, this method offers a simpler solution without GUI settings modification. However, users can only modify the ini file to change the title bar drawing behavior.
It can be used as a temporary solution while waiting for user feedback.
Decide whether to add a checkbox to the settings later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants