Skip to content

Commit

Permalink
Add isDarkModeEnabled() for NPPM_ISDARKMODEENABLED API (#270)
Browse files Browse the repository at this point in the history
Co-authored-by: VinsWorldcom <vin@vinsworld.com>
  • Loading branch information
vinsworldcom and VinsWorldcom committed Jan 2, 2023
1 parent 95b1630 commit 8a021b3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
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

0 comments on commit 8a021b3

Please sign in to comment.