Skip to content

Commit 8a021b3

Browse files
vinsworldcomVinsWorldcom
andauthored
Add isDarkModeEnabled() for NPPM_ISDARKMODEENABLED API (#270)
Co-authored-by: VinsWorldcom <[email protected]>
1 parent 95b1630 commit 8a021b3

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

PythonScript/src/NotepadPlusWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,11 @@ void NotepadPlusWrapper::docSwitcherDisablePathColumn(bool disableOrNot)
951951
callNotepad(NPPM_DOCLISTDISABLEPATHCOLUMN, 0, disableOrNot);
952952
}
953953

954+
bool NotepadPlusWrapper::isDarkModeEnabled()
955+
{
956+
return static_cast<bool>(callNotepad(NPPM_ISDARKMODEENABLED));
957+
}
958+
954959
intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding()
955960
{
956961
return callNotepad(NPPM_GETCURRENTNATIVELANGENCODING);

PythonScript/src/NotepadPlusWrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ class NotepadPlusWrapper
758758

759759
void docSwitcherDisablePathColumn(bool disableOrNot);
760760

761+
bool isDarkModeEnabled();
762+
761763
intptr_t getCurrentNativeLangEncoding();
762764

763765
boost::python::str getLanguageName(int langType);

PythonScript/src/NotepadPython.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void export_notepad()
106106
.def("isDocSwitcherShown", &NotepadPlusWrapper::isDocSwitcherShown, "Returns True if document switcher is shown else False")
107107
.def("docSwitcherDisableExtColumn", &NotepadPlusWrapper::docSwitcherDisableExtColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown")
108108
.def("docSwitcherDisablePathColumn", &NotepadPlusWrapper::docSwitcherDisablePathColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown")
109+
.def("isDarkModeEnabled", &NotepadPlusWrapper::isDarkModeEnabled, "Returns True if Dark Mode is enabled else False")
109110
.def("getCurrentNativeLangEncoding", &NotepadPlusWrapper::getCurrentNativeLangEncoding, "Returns the current native language encoding")
110111
.def("getLanguageName", &NotepadPlusWrapper::getLanguageName, boost::python::args("langType"), "Get programming language name from the given language type")
111112
.def("getLanguageDesc", &NotepadPlusWrapper::getLanguageDesc, boost::python::args("langType"), "Get programming language short description from the given language type")

docs/source/notepad.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ Notepad++ Object
325325
``True`` if it should be hidden, ``False`` if it should be shown
326326

327327

328+
.. method:: notepad.isDarkModeEnabled() -> bool
329+
330+
Returns ``True`` if Dark Mode is enabled else ``False``
331+
332+
328333
.. method:: notepad.isDocSwitcherShown() -> bool
329334

330335
Returns ``True`` if document switcher is shown else ``False``

0 commit comments

Comments
 (0)