Commit 992a178b authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Apply bold to the current line number by default

parent 7403fe68
...@@ -201,6 +201,8 @@ bool FontSettings::fromSettings(const QString &category, ...@@ -201,6 +201,8 @@ bool FontSettings::fromSettings(const QString &category,
if (fmt.isEmpty()) { if (fmt.isEmpty()) {
m_formats[name].setForeground(desc.foreground()); m_formats[name].setForeground(desc.foreground());
m_formats[name].setBackground(desc.background()); m_formats[name].setBackground(desc.background());
m_formats[name].setBold(desc.format().bold());
m_formats[name].setItalic(desc.format().italic());
} else { } else {
m_formats[name].fromString(fmt); m_formats[name].fromString(fmt);
} }
......
...@@ -101,10 +101,16 @@ FontSettingsPagePrivate::FontSettingsPagePrivate(const TextEditor::FormatDescrip ...@@ -101,10 +101,16 @@ FontSettingsPagePrivate::FontSettingsPagePrivate(const TextEditor::FormatDescrip
if (!settingsFound) { // Apply defaults if (!settingsFound) { // Apply defaults
foreach (const FormatDescription &f, m_descriptions) { foreach (const FormatDescription &f, m_descriptions) {
const QString name = f.name(); const QString name = f.name();
m_lastValue.formatFor(name).setForeground(f.foreground()); m_lastValue.formatFor(name).setForeground(f.foreground());
m_lastValue.formatFor(name).setBackground(f.background()); m_lastValue.formatFor(name).setBackground(f.background());
m_lastValue.formatFor(name).setBold(f.format().bold());
m_lastValue.formatFor(name).setItalic(f.format().italic());
m_value.formatFor(name).setForeground(f.foreground()); m_value.formatFor(name).setForeground(f.foreground());
m_value.formatFor(name).setBackground(f.background()); m_value.formatFor(name).setBackground(f.background());
m_value.formatFor(name).setBold(f.format().bold());
m_value.formatFor(name).setItalic(f.format().italic());
} }
} }
...@@ -144,11 +150,6 @@ QColor FormatDescription::foreground() const ...@@ -144,11 +150,6 @@ QColor FormatDescription::foreground() const
return m_format.foreground(); return m_format.foreground();
} }
void FormatDescription::setForeground(const QColor &foreground)
{
m_format.setForeground(foreground);
}
QColor FormatDescription::background() const QColor FormatDescription::background() const
{ {
if (m_name == QLatin1String(Constants::C_TEXT)) if (m_name == QLatin1String(Constants::C_TEXT))
......
...@@ -60,14 +60,13 @@ public: ...@@ -60,14 +60,13 @@ public:
const QColor &foreground = Qt::black); const QColor &foreground = Qt::black);
QString name() const; QString name() const;
QString trName() const; QString trName() const;
QColor foreground() const; QColor foreground() const;
void setForeground(const QColor &foreground);
QColor background() const; QColor background() const;
const Format &format() const { return m_format; }
Format &format() { return m_format; }
private: private:
QString m_name; // Name of the category QString m_name; // Name of the category
QString m_trName; // Displayed name of the category QString m_trName; // Displayed name of the category
......
...@@ -72,7 +72,10 @@ TextEditorSettings::TextEditorSettings(QObject *parent) ...@@ -72,7 +72,10 @@ TextEditorSettings::TextEditorSettings(QObject *parent)
formatDescriptions.push_back(FormatDescription(QLatin1String(C_SEARCH_SCOPE), tr("Search Scope"))); formatDescriptions.push_back(FormatDescription(QLatin1String(C_SEARCH_SCOPE), tr("Search Scope")));
formatDescriptions.push_back(FormatDescription(QLatin1String(C_PARENTHESES), tr("Parentheses"))); formatDescriptions.push_back(FormatDescription(QLatin1String(C_PARENTHESES), tr("Parentheses")));
formatDescriptions.push_back(FormatDescription(QLatin1String(C_CURRENT_LINE), tr("Current Line"))); formatDescriptions.push_back(FormatDescription(QLatin1String(C_CURRENT_LINE), tr("Current Line")));
formatDescriptions.push_back(FormatDescription(QLatin1String(C_CURRENT_LINE_NUMBER), tr("Current Line Number"), Qt::darkGray));
FormatDescription currentLineNumber = FormatDescription(QLatin1String(C_CURRENT_LINE_NUMBER), tr("Current Line Number"), Qt::darkGray);
currentLineNumber.format().setBold(true);
formatDescriptions.push_back(currentLineNumber);
// Standard categories // Standard categories
formatDescriptions.push_back(FormatDescription(QLatin1String(C_NUMBER), tr("Number"), Qt::darkBlue)); formatDescriptions.push_back(FormatDescription(QLatin1String(C_NUMBER), tr("Number"), Qt::darkBlue));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment