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

OneNote Dark mode compatibility #109

Closed
natbrood opened this issue Jan 13, 2020 · 9 comments
Closed

OneNote Dark mode compatibility #109

natbrood opened this issue Jan 13, 2020 · 9 comments

Comments

@natbrood
Copy link

It's been a while since Microsoft allowed people to use the night theme of OneNote.
As of right now, to get the proper color, I need to switch back to light mode and then, after importing, I need to switch back to dark mode.

Could dark mode compatibility be a future option?

@ahmet-cetinkaya
Copy link

I think it should be added as well.

@iamhammer
Copy link
Contributor

I would love to see Dark Mode support also.

If the Office Theme is set to Black (Dark Mode) there is an additional option in the View Tab on the ribbon. It's in the Page Setup group and is labeled Switch Background.
image

This will toggle the page contents and colors between light and dark mode but not change the chrome of the application or effect the Office Theme at large (as used by other Office Apps).

image

The registry value for this is found at
Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\OneNote\General\DarkModeCanvasLightsOn

Changing the DarkModeCanvasLightsOn registry value does toggle the Switch Background option. So if NoteHightlight would:

  1. Check this value
  2. If DarkModeCanvasLightsOn = 0 (off, display page content in dark mode) set it to 1 (Lights On, display page content in light mode)
  3. Run the normal highlighting process
  4. If DarkModeCanvasLightsOn was originally = 0, after highlighting set back to 0
  5. All of the colors should be correctly configured and displayed now in either mode.

One other thing to account for though is that setting the registry value for DarkModeCanvasLightsOn will make an immediate change (just like clicking the button in the View tab), except it will not apply to the OneNote Outline Elements that have an insertion point.

image
Above: An example of a page that was selected when LightsOn was changed from 0 to 1 via the registry. The page background changed from black to white, but the actual textbox and it's contents that contained the insertion point remained unchanged.

image
Above: An example of a page that had selected text when LightsOn was changed from 1 to 0 via the registry. The same effect as above but additionally the paragraph that contained the selected text has it's font colors augmented.

@NickolasJohnson
Copy link

So, this is a bit strange but if you switch the background to light mode, then use notehighlight and the bright style, then switch back to darkmode it looks fine. If you stay in dark mode, then use notehightlight, it makes the text all way too dark. Pic below for comparison.
image

@Sahil-h-3me
Copy link

Sahil-h-3me commented Apr 23, 2020

So, this is a bit strange but if you switch the background to light mode, then use notehighlight and the bright style, then switch back to darkmode it looks fine. If you stay in dark mode, then use notehightlight, it makes the text all way too dark. Pic below for comparison.
image

Strange when I tried that it didn't do anything. Also I'm finding even with turning off dark mode the colours are really washed out and hard to read. I'm using OneNote 2016.

@roflbofl322
Copy link

roflbofl322 commented Apr 27, 2020

The work around for this is to click "Switch background" -> write down the code -> switch back to dark mode.
image
image

@Sahil-h-3me
Copy link

Super weird work around but it works when you switch to light mode, write the code and then switch back to dark. Is there any plans to update this so we don't have to do that?

@iamhammer
Copy link
Contributor

What happened to the comments by @wuwao1 from Sep 6th, about a Dark Mode fix they'd made? Did it run afoul as their fix was replacing an assembly instead of issuing a pull request?

@wuwao1
Copy link

wuwao1 commented Sep 11, 2020

@iamhammer ,Based on your comment, I wrote the following code,FYR.Thanks.

/////////////////////////////////////////////////////////////////////////////////////////
private void shellExcuteStr(string boolDarkModeCanvasLightsOn)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
string strCMD = boolDarkModeCanvasLightsOn;
p.StandardInput.WriteLine(strCMD + " & exit");
p.StandardInput.AutoFlush = true;
p.WaitForExit();
p.Close();
}
///////////////////////////////////////////////////////////////////////////////////////////////////
string boolDarkModeCanvasLightsOn1 = @"reg add HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\OneNote\General /v DarkModeCanvasLightsOn /t REG_DWORD /d 1 /f";
shellExcuteStr(boolDarkModeCanvasLightsOn1);
//////////////////////////////////////////////////////////////////////////////////////////////////////
string boolDarkModeCanvasLightsOn = @"reg add HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\OneNote\General /vDarkModeCanvasLightsOn /t REG_DWORD /d 0 /f";
shellExcuteStr(boolDarkModeCanvasLightsOn);

As for the code I modified, the personal test results were not very good and were not submitted, so I deleted them.

@elvirbrk
Copy link
Owner

Dark mode support added to version 3.7

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

No branches or pull requests

8 participants