Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Initial dark mode support via darkmodelib#2834

Merged
sdottaka merged 1 commit intoWinMerge:masterfrom
ozone10:DarkModeInitialSupport
Jul 27, 2025
Merged

Initial dark mode support via darkmodelib#2834
sdottaka merged 1 commit intoWinMerge:masterfrom
ozone10:DarkModeInitialSupport

Conversation

@ozone10
Copy link
Contributor

@ozone10 ozone10 commented Jul 4, 2025

Currently dark mode depends on system setting and is only supported on Windows 10 build 19045 and Windows 11 on x64 or arm64. There is no dark mode setting implemented yet.

Only vs2022 variants were tested, but x86 and arm builds should work with older vs2017 and vs2019.

Unfortunately I will be busy for at least one week, so won't be able to work on this PR for now.

fix #396

@ozone10 ozone10 force-pushed the DarkModeInitialSupport branch from 3ebb6b1 to 7ec1cd4 Compare July 4, 2025 17:35
@Neustradamus
Copy link

@ozone10: Nice, thanks!

@sdottaka
Copy link
Member

sdottaka commented Jul 5, 2025

Thank you for the PR. Once I finish working on my current PR, I'd like to test this one in various scenarios.
By the way, do you plan to support switching between dark and light mode dynamically while the application is running in the future?

@ozone10
Copy link
Contributor Author

ozone10 commented Jul 5, 2025

@sdottaka
it should be possible, but I am not familiar with MFC, and how WinMerge saves settings. I will probably leave setting implementation to you and provide help if needed.

@ozone10 ozone10 force-pushed the DarkModeInitialSupport branch from 17de938 to d4ffded Compare July 26, 2025 06:15
@ozone10 ozone10 force-pushed the DarkModeInitialSupport branch from d4ffded to aa528b2 Compare July 26, 2025 06:31
@sdottaka sdottaka marked this pull request as ready for review July 27, 2025 23:42
@sdottaka sdottaka merged commit a19f71b into WinMerge:master Jul 27, 2025
3 checks passed
@sdottaka
Copy link
Member

Thank you for the PR. I’ll merge it temporarily, create a new darkmode branch, revert the changes from master, and continue development in darkmode.

sdottaka added a commit that referenced this pull request Jul 27, 2025
@dcog989
Copy link
Contributor

dcog989 commented Aug 6, 2025

Hi. I've been trying to build the darkmode branch but can't clear all the compile issues. Is there a prebuilt anywhere please?

@ozone10
Copy link
Contributor Author

ozone10 commented Aug 6, 2025

@dcog989
this branch https://github.com/WinMerge/winmerge/tree/darkmode?
After you switch to that branch, run

git submodule init
git submodule update

You may also need to adjust sdk version since WinMerge is currently using

<WindowsTargetPlatformVersion Condition="'$(VisualStudioVersion)' &gt;= '16'">10.0.22621.0</WindowsTargetPlatformVersion>

instead of latest, and remove #if check for #pragma comment(lib, "windowsapp.lib")

#if !__has_include(<winrt/windows.applicationmodel.holographic.h>)
#pragma comment(lib, "windowsapp.lib") // < Windows SDK 10.0.22000.0
#endif

@ozone10 ozone10 deleted the DarkModeInitialSupport branch August 6, 2025 14:58
@dcog989
Copy link
Contributor

dcog989 commented Aug 6, 2025

@ozone10 - thanks very much, I think I followed those instructions and permutations of, but I must be missing something:

function call missing argument list
'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
Custom build for 'D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterLexer.re;D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterParser.y' exited with code 9009.
Custom build for 'D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterLexer.re;D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterParser.y' exited with code 9009.	

I'm still running one of the builds from your testing, was hoping to update, but it's not essential.

@sdottaka
Copy link
Member

sdottaka commented Aug 7, 2025

@dcog989
Running DownloadDeps.cmd in the WinMerge directory should download the tools needed to process FilterParser.y, which will likely resolve the build error.

@dcog989
Copy link
Contributor

dcog989 commented Aug 7, 2025

hey. thanks, that moved things forward but stuck with:

Custom build for 'D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterLexer.re;D:\Downloads\winmerge dark 1\winmerge\Src\FilterEngine\FilterParser.y' exited with code 9009.

Something to do with flex / bison missing??? I added https://github.com/lexxmark/winflexbison/releases/tag/v2.5.25 to path but that didn't help.

@sdottaka
Copy link
Member

sdottaka commented Aug 9, 2025

It seems DownloadDeps.cmd does not work properly if the folder name contains spaces, such as “winmerge dark 1.” Please try using a folder name without spaces.

@dcog989
Copy link
Contributor

dcog989 commented Aug 9, 2025

That did it! Many thanks. :)

sdottaka added a commit that referenced this pull request Aug 16, 2025
* ALL.vs2022.sln: Add darkmodelib as a dependency of the Merge project

* Update frhed and sevenzip

* Fix issue where font dialog was not translated

* Fix issue where the color dialog opened from the Options dialog did not use dark mode

* WIP: Add Color mode option to Options dialog

* WIP: Add Color mode option to Options dialog (2)

* Add MyColorDialog.*

* Add MyFontDialog.*

* WIP: Add Color mode option to Options dialog (3)

* WIP: Add Color mode option to Options dialog (4)

* Fix batch file execution failure when working directory contains spaces

* Support dark mode for background and text colors when filter expressions have errors

* WIP: Add Color mode option to Options dialog (5)

* In dark mode builds, the Syntax Highlight menu no longer used multiple columns, making it harder to use. Split the languages into A–L and M–Z submenus.

* Support dark mode for background and text colors when filter expressions have errors (2)

* BCMenu.cpp: Correct radio dot color rendering in dark mode

* crystaledit: Prevent lines from rendering black when using dark color scheme

* DirSelectFilesDlg.cpp: Fix DirSelectFilesDlg not applying dark mode

* HexMergeDoc.cpp: Fix text color of differences appearing black in dark color scheme

* - Improve dark mode support for comparison windows using heksedit, winimergelib, and winwebdifflib
- Update frhed 0.10904.2017.18
- Update winimerge to 1.0.46
- Update winwebdiff to 1.0.19.0

* Update Japanese translation

* Attempt to fix CodeQL Analysis failure
Marcellomco added a commit to Marcellomco/winmerge that referenced this pull request Aug 16, 2025
Added translation for "Dark Mode Enhancements Following PR WinMerge#2834 (WinMerge#2885)"
@Marcellomco Marcellomco mentioned this pull request Aug 16, 2025
sdottaka pushed a commit that referenced this pull request Aug 16, 2025
Added translation for "Dark Mode Enhancements Following PR #2834 (#2885)"
@sdottaka sdottaka added this to the v2.16.51 milestone Aug 26, 2025
@sdottaka
Copy link
Member

@ozone10
Since statically linking an MPL-2.0 library with WinMerge (GPLv2-or-later) could cause license conflicts, we forked darkmodelib
and built it as a DLL. We now use this DLL dynamically to ensure license compatibility.

@ozone10
Copy link
Contributor Author

ozone10 commented Sep 16, 2025

@sdottaka
there should be no conflict. I don't use Exhibit B - “Incompatible With Secondary Licenses” Notice, so it can be linked statically without issue.

@sdottaka
Copy link
Member

@ozone10

You're right — according to GNU’s license list, there’s no issue. Sorry for the confusion; I trusted an AI answer without checking carefully. That said, I’ll probably keep using the DLL, since it also allows the x86 build of WinMerge to support DarkMode. (The x86 build still supports Windows XP and uses an older SDK, which fails to compile darkmodelib from source.)

@ozone10
Copy link
Contributor Author

ozone10 commented Sep 17, 2025

@sdottaka
I took inspiration from your fork with DLL commits. Unfortunately I might have introduced some conflicts for you, I am sorry.
My goal was to make it easier to use GetProcAdress / LoadLibrary for explicit loading and option to change DLLs without needs to recompile whole app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Dark mode

4 participants

Comments