void serializeBaseStyle() { DCHECK(!m_isInGroup); PagePopupClient::addString("baseStyle: {", m_buffer); addProperty("backgroundColor", m_backgroundColor.serialized(), m_buffer); addProperty( "color", baseStyle().visitedDependentColor(CSSPropertyColor).serialized(), m_buffer); addProperty("textTransform", String(textTransformToString(baseStyle().textTransform())), m_buffer); addProperty("fontSize", baseFont().specifiedSize(), m_buffer); addProperty("fontStyle", String(fontStyleToString(baseFont().style())), m_buffer); addProperty("fontVariant", baseFont().variantCaps() == FontDescription::SmallCaps ? String("small-caps") : String(), m_buffer); PagePopupClient::addString("fontFamily: [", m_buffer); for (const FontFamily* f = &baseFont().family(); f; f = f->next()) { addJavaScriptString(f->family().getString(), m_buffer); if (f->next()) PagePopupClient::addString(",", m_buffer); } PagePopupClient::addString("]", m_buffer); PagePopupClient::addString("},\n", m_buffer); }
void serializeBaseStyle() { ASSERT(!m_isInGroup); PagePopupClient::addString("baseStyle: {", m_buffer); addProperty("backgroundColor", m_backgroundColor.serialized(), m_buffer); addProperty("color", baseStyle().visitedDependentColor(CSSPropertyColor).serialized(), m_buffer); addProperty("textTransform", String(textTransformToString(baseStyle().textTransform())), m_buffer); addProperty("fontSize", baseFont().computedPixelSize(), m_buffer); addProperty("fontStyle", String(fontStyleToString(baseFont().style())), m_buffer); addProperty("fontVariant", String(fontVariantToString(baseFont().variant())), m_buffer); PagePopupClient::addString("fontFamily: [", m_buffer); for (const FontFamily* f = &baseFont().family(); f; f = f->next()) { addJavaScriptString(f->family().string(), m_buffer); if (f->next()) PagePopupClient::addString(",", m_buffer); } PagePopupClient::addString("]", m_buffer); PagePopupClient::addString("},\n", m_buffer); }
void SqlEditorWidget::prefsChanged() { QFont baseFont(m_prefs->sqlFont()); baseFont.setPointSize(m_prefs->sqlFontSize()); lexer()->setFont(baseFont); setFont(baseFont); // syntax highlighting lexer()->setColor(m_prefs->syDefaultColor(), QsciLexerSQL::Default); lexer()->setColor(m_prefs->syKeywordColor(), QsciLexerSQL::Keyword); QFont defFont(lexer()->font(QsciLexerSQL::Keyword)); defFont.setBold(true); lexer()->setFont(defFont, QsciLexerSQL::Keyword); lexer()->setColor(m_prefs->syNumberColor(), QsciLexerSQL::Number); lexer()->setColor(m_prefs->syStringColor(), QsciLexerSQL::SingleQuotedString); lexer()->setColor(m_prefs->syStringColor(), QsciLexerSQL::DoubleQuotedString); lexer()->setColor(m_prefs->syCommentColor(), QsciLexerSQL::Comment); lexer()->setColor(m_prefs->syCommentColor(), QsciLexerSQL::CommentLine); lexer()->setColor(m_prefs->syCommentColor(), QsciLexerSQL::CommentDoc); setAutoCompletionThreshold(m_prefs->codeCompletion() ? m_prefs->codeCompletionLength() : -1 ); if (m_prefs->textWidthMark()) { setEdgeColumn(m_prefs->textWidthMarkSize()); setEdgeColor(Qt::gray); setEdgeMode(QsciScintilla::EdgeLine); } else setEdgeMode(QsciScintilla::EdgeNone); setMarkerBackgroundColor(m_prefs->activeHighlighting() ? m_prefs->activeHighlightColor() : paper()); }