zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
3.33k stars 212 forks source link

Dark Mode #105

Open zufuliu opened 5 years ago

zufuliu commented 5 years ago

2nd default scheme now configured as base style for dark mode (commit f587369d0711c015ff42623f4e6dbedccb2ae509).

Built-in lexer styles still not configured for dark mode, some color (red, blue, etc.) is very ugly in dark mode. dark-python

testinsovr commented 5 years ago

Basically, it would be nice if the color caret is the opposite of the background color. Even with various color background settings, the carats will be visible.

and, some opinion. issue - Batch - label 'fore: # C80000; back: # F4F4F4; eolfilled ' It would be nice to change it to the default value.

testinsovr commented 5 years ago

'Set built-in style for Batch label to eolfilled.' Thank you very much.

zufuliu commented 5 years ago

I think dark mode / theme is ready, I added a new screenshot for v4.19.04.

v4.19.04

Menu, toolbar and statusbar requires complicate custom drawing for dark mode, are not implemented.

zufuliu commented 5 years ago

The white area above auto-completion box on win10 (above screenshot by v4.19.04) was removed in v4.19.06. Related discussion can be found at https://sourceforge.net/p/scintilla/feature-requests/1284/.

v4.19.06

jzhao2007 commented 4 years ago

Hi,zu did you get this one patched for the new version? I am running 4.19.06 r2148 now, cursor is still invisible in the dark mode

zufuliu commented 4 years ago

@jzhao2007 can you try v4.19.12.r2604 and replace Notepad2 DarkTheme.ini with the one in zip.

maboroshin commented 4 years ago

Hi! I created 18 color themes. maboroshin/Notepad2ColorTheme

My recommendations: In order, Solarized Dark, Iceburg (Dark), Solarized Light. My tweaks are now visible in probably all languages. In Solarized (Notepad2_Solarized.ini), color scheme 1 is light and color scheme 2 is dark. But some languages in this light theme are a bit darker.

zufuliu commented 4 years ago

Unfortunately, Notepad2 doesn't auto discover theme files.

maboroshin commented 4 years ago

With the import feature, I can easily use my favorite light and dark!

zufuliu commented 4 years ago

There are code to detect system dark mode on Win 10:

https://sourceforge.net/p/scintilla/scite/ci/09b21fe9d954ba1b350289fdbe7b16d59f7134ac/

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize
    AppsUseLightTheme           REG_DWORD
    SystemUsesLightTheme        REG_DWORD
HIGHCONTRAST info{};
info.cbSize = sizeof(HIGHCONTRAST)
SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &info, 0);
info.dwFlags & HCF_HIGHCONTRASTON;
maboroshin commented 4 years ago

This is simple.

If the system is in dark mode when Notepad2's auto-detection setting is on, apply the dark theme. New menu: Style Theme -> Auto Detect (or System Color ... etc)

Apps such as the following are already auto-detected.

zufuliu commented 4 years ago

It can be added later. by the way, you can use DarkTheme.ini (in Notepad2 section in Notepad2.ini) to set custom theme file path, without import.

[Notepad2]
;Notepad2.ini=%LOCALAPPDATA%\Notepad2\Notepad2.ini
;DarkTheme.ini=%LOCALAPPDATA%\Notepad2\Notepad2 DarkTheme.ini
[Settings]
SettingsVersion=1
ejm554 commented 2 years ago

Question from occasional user (but still a fan!) of Notepad2.

How do you turn Dark Mode on? Is there a setting in the GUI? Do I need to configure the .ini or other files?

zufuliu commented 2 years ago

Hi @ejm554, the settings menu is Scheme -> Style Theme.

ejm554 commented 1 year ago

Thanks, but still struggling to find it. Is it in one of the following menus/windows? Or am I missing something? I also tried turning on the 2nd default scheme, as noted in the original post in this issue thread, but I didn't notice any changes.

If you could provide more explicit steps, maybe with screenshots, that might help! FYI, I'm running 4.2.25 r998.

image

image

zufuliu commented 1 year ago

Hi @ejm554 please download latest release from https://github.com/zufuliu/notepad2/releases Dark

Spode commented 1 year ago

Hey all. Could full dark mode support be added where the entire UI can be made dark (preferably based on OS setting like previously mentioned in the thread)? I am a big fan of this fork of Notepad2 with all its features, but during night time I reluctantly use alternatives due to this.

Notepad3 implemented it using https://github.com/ysc3839/win32-darkmode/

Notepad3 using Windows 11 Dark theme np3dark

Notepad3 using Windows 11 Default theme np3light

Notepad2 using Windows 11 Dark theme np2dark

Notepad2 using Windows 11 Dark theme but Dark Style manually enabled np2darksyntax

Heporis commented 5 months ago

尝试了6个轻量级的编辑器,有的语法高亮、自动补全不够智能,有的折叠识别有问题,有的查找替换不好用,你的这个是最好用的,就是晚上太刺眼了,如果主界面也能应用黑暗模式就完美了。 感谢你一直以来的开发!

Jackarain commented 2 months ago

哈哈,通过简单的整合三方的代码,我已经完成了主界面的黑暗模式,效果如下图:

image

有需要可以到我的 fork 中下载预编译版本,或通过 cmake 自行编译 DarkMode 分支。

必须提到的是,因为本人不喜欢白模式,所以是直接硬编码无法设置回白天模式。

m2nlight commented 2 months ago

如果有暗模式和txt超链接,就不用notepad3当默认编辑器了。