NotepadPlusPlusPluginPack.Net
NotepadPlusPlusPluginPack.Net copied to clipboard
Apply dark mode to all forms automatically
Based on https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/104. rdipardo did all the hard work here, this is just a refinement. That said, I would strongly urge using this PR instead.
This makes it easy for plugin makers to apply dark mode to all forms. Rather than having to individually select themes to apply for each control, sensible defaults are applied based on each control's type. This PR also allows the color changes to propagate recursively to a form's child forms, if it has any.
Light mode
Dark mode

At present, this PR only makes form colors match the Notepad++ background if Dark Mode is enabled. However, a user could use a specially colored theme like Navajo or Bespin while in Light Mode, and this PR does not help forms match background color in those cases.
In JsonTools, I implemented something (based on CSVQuery) that does this. It's not as good for Dark Mode as this PR, but it leads to pretty OK-looking visual results in general.
However, because this PR is already quite large, I didn't include it.
The theme in the above image is MossyLawn.
conflicts
@molsonkiko, you need to rebase your branch before @kbilsted can merge it.
- Go to your local copy of the PR topic branch:
$ git checkout apply_dark_mode_to_arbitrary_controls
Switched to branch 'apply_dark_mode_to_arbitrary_controls'
Your branch is up to date with 'origin/apply_dark_mode_to_arbitrary_controls'.
- Add the target repo as a remote:
$ git remote add upstream https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net.git
$ git fetch upstream
From https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
* [new branch] master -> upstream/master
* [new branch] pr/documentation1 -> upstream/pr/documentation1
* [new tag] 0.6 -> 0.6
* [new tag] 0.8 -> 0.8
* [new tag] 0.90 -> 0.90
* [new tag] 0.91.52 -> 0.91.52
* [new tag] 0.91.57 -> 0.91.57
* [new tag] 0.91.71 -> 0.91.71
* [new tag] 0.92.76 -> 0.92.76
* [new tag] 0.92.83 -> 0.92.83
* [new tag] 0.93.87 -> 0.93.87
* [new tag] 0.93.96 -> 0.93.96
* [new tag] 0.94.00 -> 0.94.00
* [new tag] 0.95.00 -> 0.95.00
- Bring all recent commits from the target repo into your branch. Note. This is supposed to fail because there are confilcts.
$ git rebase upstream/master
Auto-merging Demo Plugin/NppManagedPluginDemo/Demo.cs
Auto-merging Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csproj
CONFLICT (content): Merge conflict in Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csproj
error: could not apply 7e673e5... apply dark mode to all forms automatically
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 7e673e5... apply dark mode to all forms automatically Based on https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/104 Rdipardo did all the hard work here, this is just a refinement.
- Overwrite the target repo's conflicting copy with your local copy of the
NppManagedPluginDemo.csprojfile:
$ git checkout HEAD -- "Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csproj"
- Now commit the changes from the target repo.
$ git rebase --continue
- Make sure the project still builds locally. Then force push the modified history to your topic branch.
$ git push origin -u apply_dark_mode_to_arbitrary_controls --force
Thanks for your help, @rdipardo! I should be able to do that Sunday evening.
On Fri, Jun 16, 2023, 5:28 PM rdipardo @.***> wrote:
@molsonkiko https://github.com/molsonkiko, you need to rebase your branch before @kbilsted https://github.com/kbilsted can merge it.
- Go to your local copy of the PR topic branch:
$ git checkout apply_dark_mode_to_arbitrary_controlsSwitched to branch 'apply_dark_mode_to_arbitrary_controls'Your branch is up to date with 'origin/apply_dark_mode_to_arbitrary_controls'.
- Add the target repo as a remote:
$ git remote add upstream https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net.git $ git fetch upstream From https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net * [new branch] master -> upstream/master * [new branch] pr/documentation1 -> upstream/pr/documentation1 * [new tag] 0.6 -> 0.6 * [new tag] 0.8 -> 0.8 * [new tag] 0.90 -> 0.90 * [new tag] 0.91.52 -> 0.91.52 * [new tag] 0.91.57 -> 0.91.57 * [new tag] 0.91.71 -> 0.91.71 * [new tag] 0.92.76 -> 0.92.76 * [new tag] 0.92.83 -> 0.92.83 * [new tag] 0.93.87 -> 0.93.87 * [new tag] 0.93.96 -> 0.93.96 * [new tag] 0.94.00 -> 0.94.00 * [new tag] 0.95.00 -> 0.95.00
- Bring all recent commits from the target repo into your branch. Note. This is supposed to fail because there are confilcts.
$ git rebase upstream/master Auto-merging Demo Plugin/NppManagedPluginDemo/Demo.csAuto-merging Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csprojCONFLICT (content): Merge conflict in Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csprojerror: could not apply 7e673e5... apply dark mode to all forms automaticallyhint: Resolve all conflicts manually, mark them as resolved withhint: "git add/rm <conflicted_files>", then run "git rebase --continue".hint: You can instead skip this commit: run "git rebase --skip".hint: To abort and get back to the state before "git rebase", run "git rebase --abort".Could not apply 7e673e5... apply dark mode to all forms automatically Based on https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/104 Rdipardo did all the hard work here, this is just a refinement.
- Overwrite the target repo's conflicting copy with your local copy of the NppManagedPluginDemo.csproj file:
$ git checkout HEAD -- "Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csproj"
- Now commit the changes from the target repo.
$ git rebase --continue
- Make sure the project still builds locally. Then force push the modified history to your topic branch.
$ git push origin -u apply_dark_mode_to_arbitrary_controls --force
— Reply to this email directly, view it on GitHub https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net/pull/107#issuecomment-1595512943, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALAQAI5R674QE5VJBDIXIK3XLT23PANCNFSM6AAAAAAXPUT6AI . You are receiving this because you were mentioned.Message ID: @.***>