|
Mantid
|
Defines a Python lexer with a alternative colour scheme to the standard one provided by QsciLexerPython. More...
#include <AlternateCSPythonLexer.h>
Public Member Functions | |
| AlternateCSPythonLexer (const QFont &font) | |
| Construct a lexer with a font to be used for all text styles. | |
| QColor | defaultColor (int style) const override |
| Returns the foreground colour of the text for a style. | |
| QFont | defaultFont (int style) const override |
| Returns the font of the text. | |
| QColor | defaultPaper (int style) const override |
| const char * | keywords (int set) const override |
| ** | |
| void | setDarkMode (bool dark) |
Private Member Functions | |
| QColor | defaultColorDark (int style) const |
| Returns the foreground colour of the text for a dark theme style. | |
| QColor | defaultColorLight (int style) const |
| Returns the foreground colour of the text for a light theme style. | |
Private Attributes | |
| QFont | m_font |
| bool | m_isDarkMode {false} |
Static Private Attributes | |
| static constexpr const char * | customKeywords = "True False" |
Defines a Python lexer with a alternative colour scheme to the standard one provided by QsciLexerPython.
Definition at line 15 of file AlternateCSPythonLexer.h.
| AlternateCSPythonLexer::AlternateCSPythonLexer | ( | const QFont & | font | ) |
Construct a lexer with a font to be used for all text styles.
| font | A font to used for the text |
Definition at line 14 of file AlternateCSPythonLexer.cpp.
References m_isDarkMode.
|
override |
Returns the foreground colour of the text for a style.
| style | An enum defining the type of element encountered |
Definition at line 28 of file AlternateCSPythonLexer.cpp.
References defaultColorDark(), defaultColorLight(), and m_isDarkMode.
Referenced by setDarkMode().
|
private |
Returns the foreground colour of the text for a dark theme style.
| style | An enum defining the type of element encountered |
Definition at line 98 of file AlternateCSPythonLexer.cpp.
Referenced by defaultColor().
|
private |
Returns the foreground colour of the text for a light theme style.
| style | An enum defining the type of element encountered |
Definition at line 37 of file AlternateCSPythonLexer.cpp.
Referenced by defaultColor().
|
override |
Returns the font of the text.
| style | Unused. |
Definition at line 161 of file AlternateCSPythonLexer.cpp.
References m_font.
|
override |
Definition at line 186 of file AlternateCSPythonLexer.cpp.
References m_isDarkMode.
Referenced by setDarkMode().
|
override |
| void AlternateCSPythonLexer::setDarkMode | ( | bool | dark | ) |
Definition at line 191 of file AlternateCSPythonLexer.cpp.
References defaultColor(), defaultPaper(), and m_isDarkMode.
|
staticconstexprprivate |
Definition at line 29 of file AlternateCSPythonLexer.h.
Referenced by keywords().
|
private |
Definition at line 28 of file AlternateCSPythonLexer.h.
Referenced by defaultFont().
|
private |
Definition at line 30 of file AlternateCSPythonLexer.h.
Referenced by AlternateCSPythonLexer(), defaultColor(), defaultPaper(), and setDarkMode().