Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Apply dark mode to all forms automatically #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

molsonkiko
Copy link
Contributor

Based on #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
image
Dark mode
image

@molsonkiko
Copy link
Contributor Author

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.
image
The theme in the above image is MossyLawn.

@kbilsted
Copy link
Owner

conflicts

@rdipardo
Copy link

@molsonkiko, you need to rebase your branch before @kbilsted can merge it.

  1. 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'.
  1. 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
  1. 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.
  1. Overwrite the target repo's conflicting copy with your local copy of the NppManagedPluginDemo.csproj file:
$ git checkout HEAD -- "Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.csproj"
  1. Now commit the changes from the target repo.
$ git rebase --continue
  1. 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 

@molsonkiko
Copy link
Contributor Author

molsonkiko commented Jun 17, 2023 via email

Based on kbilsted#104
Rdipardo did all the hard work here, this is just a refinement.

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.
1. Add automatic handling of GroupBoxes, DataGridViews
2. Fix problems with .csproj caused by rebase
@molsonkiko molsonkiko force-pushed the apply_dark_mode_to_arbitrary_controls branch from ab70481 to 16d3516 Compare June 20, 2023 03:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants