forked from qt-creator/qt-creator
		
	Use Field instead of Label format for QML properties
In the default style this is currently the same, but in general it makes more sense to highlight properties as fields.
This commit is contained in:
		@@ -1171,7 +1171,7 @@ void QmlJSTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_STRING)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_TYPE)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_KEYWORD)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_LABEL)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_FIELD)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_COMMENT)
 | 
			
		||||
                << QLatin1String(TextEditor::Constants::C_VISUAL_WHITESPACE);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -62,11 +62,6 @@ void Highlighter::setQmlEnabled(bool qmlEnabled)
 | 
			
		||||
    m_qmlEnabled = qmlEnabled;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QTextCharFormat Highlighter::labelTextCharFormat() const
 | 
			
		||||
{
 | 
			
		||||
    return m_formats[LabelFormat];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool checkStartOfBinding(const Token &token)
 | 
			
		||||
{
 | 
			
		||||
    switch (token.kind) {
 | 
			
		||||
@@ -197,7 +192,7 @@ void Highlighter::highlightBlock(const QString &text)
 | 
			
		||||
                            // it's a binding.
 | 
			
		||||
                            for (int i = start; i <= index; ++i) {
 | 
			
		||||
                                const Token &tok = tokens.at(i);
 | 
			
		||||
                                setFormat(tok.offset, tok.length, m_formats[LabelFormat]);
 | 
			
		||||
                                setFormat(tok.offset, tok.length, m_formats[FieldFormat]);
 | 
			
		||||
                            }
 | 
			
		||||
                            break;
 | 
			
		||||
                        } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ public:
 | 
			
		||||
        StringFormat,
 | 
			
		||||
        TypeFormat,
 | 
			
		||||
        KeywordFormat,
 | 
			
		||||
        LabelFormat,
 | 
			
		||||
        FieldFormat,
 | 
			
		||||
        CommentFormat,
 | 
			
		||||
        VisualWhitespace,
 | 
			
		||||
        NumFormats
 | 
			
		||||
@@ -66,8 +66,6 @@ public:
 | 
			
		||||
    void setQmlEnabled(bool duiEnabled);
 | 
			
		||||
    void setFormats(const QVector<QTextCharFormat> &formats);
 | 
			
		||||
 | 
			
		||||
    QTextCharFormat labelTextCharFormat() const;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
    virtual void highlightBlock(const QString &text);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user