forked from qt-creator/qt-creator
Customizable doxy formats.
This commit is contained in:
@@ -740,7 +740,9 @@ void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
|
|||||||
<< QLatin1String(TextEditor::Constants::C_OPERATOR)
|
<< QLatin1String(TextEditor::Constants::C_OPERATOR)
|
||||||
<< QLatin1String(TextEditor::Constants::C_PREPROCESSOR)
|
<< QLatin1String(TextEditor::Constants::C_PREPROCESSOR)
|
||||||
<< QLatin1String(TextEditor::Constants::C_LABEL)
|
<< QLatin1String(TextEditor::Constants::C_LABEL)
|
||||||
<< QLatin1String(TextEditor::Constants::C_COMMENT);
|
<< QLatin1String(TextEditor::Constants::C_COMMENT)
|
||||||
|
<< QLatin1String(TextEditor::Constants::C_DOXYGEN_COMMENT)
|
||||||
|
<< QLatin1String(TextEditor::Constants::C_DOXYGEN_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
|
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
|
||||||
|
@@ -51,6 +51,8 @@ enum CppFormats {
|
|||||||
CppPreprocessorFormat,
|
CppPreprocessorFormat,
|
||||||
CppLabelFormat,
|
CppLabelFormat,
|
||||||
CppCommentFormat,
|
CppCommentFormat,
|
||||||
|
CppDoxygenCommentFormat,
|
||||||
|
CppDoxygenTagFormat,
|
||||||
NumCppFormats
|
NumCppFormats
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -329,10 +329,8 @@ void CppHighlighter::highlightDoxygenComment(const QString &text, int position,
|
|||||||
const QChar *uc = text.unicode();
|
const QChar *uc = text.unicode();
|
||||||
const QChar *it = uc + position;
|
const QChar *it = uc + position;
|
||||||
|
|
||||||
QTextCharFormat format = m_formats[CppCommentFormat];
|
const QTextCharFormat &format = m_formats[CppDoxygenCommentFormat];
|
||||||
QTextCharFormat kwFormat = format;
|
const QTextCharFormat &kwFormat = m_formats[CppDoxygenTagFormat];
|
||||||
kwFormat.setFontWeight(QFont::Bold);
|
|
||||||
kwFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
|
|
||||||
|
|
||||||
while (! it->isNull()) {
|
while (! it->isNull()) {
|
||||||
if (it->unicode() == QLatin1Char('\\') ||
|
if (it->unicode() == QLatin1Char('\\') ||
|
||||||
|
@@ -84,6 +84,9 @@ const char * const C_OPERATOR = "Operator";
|
|||||||
const char * const C_PREPROCESSOR = "Preprocessor";
|
const char * const C_PREPROCESSOR = "Preprocessor";
|
||||||
const char * const C_LABEL = "Label";
|
const char * const C_LABEL = "Label";
|
||||||
const char * const C_COMMENT = "Comment";
|
const char * const C_COMMENT = "Comment";
|
||||||
|
const char * const C_DOXYGEN_COMMENT = "Doxygen.Comment";
|
||||||
|
const char * const C_DOXYGEN_TAG = "Doxygen.Tag";
|
||||||
|
|
||||||
const char * const C_DISABLED_CODE = "DisabledCode";
|
const char * const C_DISABLED_CODE = "DisabledCode";
|
||||||
|
|
||||||
const char * const C_ADDED_LINE = "AddedLine";
|
const char * const C_ADDED_LINE = "AddedLine";
|
||||||
|
@@ -84,6 +84,8 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
|
|||||||
formatDescriptions.push_back(FormatDescription(QLatin1String(C_PREPROCESSOR), tr("Preprocessor"), Qt::darkBlue));
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_PREPROCESSOR), tr("Preprocessor"), Qt::darkBlue));
|
||||||
formatDescriptions.push_back(FormatDescription(QLatin1String(C_LABEL), tr("Label"), Qt::darkRed));
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_LABEL), tr("Label"), Qt::darkRed));
|
||||||
formatDescriptions.push_back(FormatDescription(QLatin1String(C_COMMENT), tr("Comment"), Qt::darkGreen));
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_COMMENT), tr("Comment"), Qt::darkGreen));
|
||||||
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DOXYGEN_COMMENT), tr("Doxygen Comment"), Qt::darkBlue));
|
||||||
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DOXYGEN_TAG), tr("Doxygen Tag"), Qt::blue));
|
||||||
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DISABLED_CODE), tr("Disabled Code"), Qt::gray));
|
formatDescriptions.push_back(FormatDescription(QLatin1String(C_DISABLED_CODE), tr("Disabled Code"), Qt::gray));
|
||||||
|
|
||||||
// Diff categories
|
// Diff categories
|
||||||
|
Reference in New Issue
Block a user