NotepadNext
NotepadNext copied to clipboard
Dark mode
My system is using mostly QT apps and its configured with a dark theme that every qt app respects, even xnviewmp with system libs, which doesnt have a dark mode in windows i believe. However notepadNext doesnt. I dont know if its something that interests you, but I believe having a dark mode will give NotepadNext a popularity boost.
Hi @Jogai, i think you should extend issue as "theme support". It shouldn't hard to implement dark mode support if you have some qt knowledge. For a simple solution you may invoke setStyleSheet method.
https://doc.qt.io/qt-6/stylesheet-examples.html
I would like to come with proof of concept pr but unfortunately my computer is broken. I believe you can implement a simple dark theme by trial and error before @dail8859 step up. Good luck.
My understanding is that using the Flatpak will follow the system Qt theme. The AppImage will not.
That being said...having user defined themes (eg loading a css file) would be good to have eventually.
I didnt use flatpak or appimage, I took it from the aur, which is a source build: https://aur.archlinux.org/packages/notepadnext
I have no clue how that works since it's not an official distribution mechanism for this project.
You can technically already launch the application with a custom CSS stylesheet by command line.
NotepadNext.exe -stylesheet style.css
You just need to create a style.css
file in the same directory as the application. You can of course name the file something different or put it in a different location and specify the path on the command line.
It won't be perfect because the application uses its own stylesheet internally for tweaking some elements. But you can do some things quickly to test with, for example:
Well, that's an option, but I was thinking more along the lines of this: https://successfulsoftware.net/2021/03/31/how-to-add-a-dark-theme-to-your-qt-application/
@Jogai
That points out a few ways to auto detect the OS preference but really just boils down to loading the appropriate CSS file.
The example I showed above was obviously very ugly and not suggesting using a red theme.
Yeah, but I tought that might be the problem. I styled my OS with kvantum and every app loads the same style. I thought maybe notepad next skips the os-wide stuff because its still white.
I don't know anything about packages from aur but at least for flatpak distribution it is known to work with custom OS themes.
https://github.com/dail8859/NotepadNext/issues/109#issuecomment-1105907443
The application has its own internal stylesheet but it only tweaks things that are absolutely necessary. https://github.com/dail8859/NotepadNext/blob/master/src/NotepadNext/stylesheets/npp.css
This works now in the 0.5.4 version
@Jogai Awesome! Glad to hear it is working now.
AppImage only change titlebar in dark mode (CutefishOS).