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

Add isDarkModeEnabled() for NPPM_ISDARKMODEENABLED API #270

Merged
merged 1 commit into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions PythonScript/src/NotepadPlusWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,11 @@ void NotepadPlusWrapper::docSwitcherDisablePathColumn(bool disableOrNot)
callNotepad(NPPM_DOCLISTDISABLEPATHCOLUMN, 0, disableOrNot);
}

bool NotepadPlusWrapper::isDarkModeEnabled()
{
return static_cast<bool>(callNotepad(NPPM_ISDARKMODEENABLED));
}

intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding()
{
return callNotepad(NPPM_GETCURRENTNATIVELANGENCODING);
Expand Down
2 changes: 2 additions & 0 deletions PythonScript/src/NotepadPlusWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,8 @@ class NotepadPlusWrapper

void docSwitcherDisablePathColumn(bool disableOrNot);

bool isDarkModeEnabled();

intptr_t getCurrentNativeLangEncoding();

boost::python::str getLanguageName(int langType);
Expand Down
1 change: 1 addition & 0 deletions PythonScript/src/NotepadPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void export_notepad()
.def("isDocSwitcherShown", &NotepadPlusWrapper::isDocSwitcherShown, "Returns True if document switcher is shown else False")
.def("docSwitcherDisableExtColumn", &NotepadPlusWrapper::docSwitcherDisableExtColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown")
.def("docSwitcherDisablePathColumn", &NotepadPlusWrapper::docSwitcherDisablePathColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown")
.def("isDarkModeEnabled", &NotepadPlusWrapper::isDarkModeEnabled, "Returns True if Dark Mode is enabled else False")
.def("getCurrentNativeLangEncoding", &NotepadPlusWrapper::getCurrentNativeLangEncoding, "Returns the current native language encoding")
.def("getLanguageName", &NotepadPlusWrapper::getLanguageName, boost::python::args("langType"), "Get programming language name from the given language type")
.def("getLanguageDesc", &NotepadPlusWrapper::getLanguageDesc, boost::python::args("langType"), "Get programming language short description from the given language type")
Expand Down
5 changes: 5 additions & 0 deletions docs/source/notepad.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ Notepad++ Object
``True`` if it should be hidden, ``False`` if it should be shown


.. method:: notepad.isDarkModeEnabled() -> bool

Returns ``True`` if Dark Mode is enabled else ``False``


.. method:: notepad.isDocSwitcherShown() -> bool

Returns ``True`` if document switcher is shown else ``False``
Expand Down