summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-06-12 15:28:51 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-06-12 15:45:35 +0200
commit992a178be33538ec256861d3bd54d9adc40027ea (patch)
tree364e12e05886eb1d959fb38adbe3d73fb465294f
parent7403fe681ce9c0e04a54e966532ab54558287932 (diff)
downloadqt-creator-992a178be33538ec256861d3bd54d9adc40027ea.tar.gz
Apply bold to the current line number by default
-rw-r--r--src/plugins/texteditor/fontsettings.cpp2
-rw-r--r--src/plugins/texteditor/fontsettingspage.cpp11
-rw-r--r--src/plugins/texteditor/fontsettingspage.h7
-rw-r--r--src/plugins/texteditor/texteditorsettings.cpp5
4 files changed, 15 insertions, 10 deletions
diff --git a/src/plugins/texteditor/fontsettings.cpp b/src/plugins/texteditor/fontsettings.cpp
index 441a7a6711..778bdbb0d2 100644
--- a/src/plugins/texteditor/fontsettings.cpp
+++ b/src/plugins/texteditor/fontsettings.cpp
@@ -201,6 +201,8 @@ bool FontSettings::fromSettings(const QString &category,
if (fmt.isEmpty()) {
m_formats[name].setForeground(desc.foreground());
m_formats[name].setBackground(desc.background());
+ m_formats[name].setBold(desc.format().bold());
+ m_formats[name].setItalic(desc.format().italic());
} else {
m_formats[name].fromString(fmt);
}
diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp
index 7f7b5d182c..740740443c 100644
--- a/src/plugins/texteditor/fontsettingspage.cpp
+++ b/src/plugins/texteditor/fontsettingspage.cpp
@@ -101,10 +101,16 @@ FontSettingsPagePrivate::FontSettingsPagePrivate(const TextEditor::FormatDescrip
if (!settingsFound) { // Apply defaults
foreach (const FormatDescription &f, m_descriptions) {
const QString name = f.name();
+
m_lastValue.formatFor(name).setForeground(f.foreground());
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).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
return m_format.foreground();
}
-void FormatDescription::setForeground(const QColor &foreground)
-{
- m_format.setForeground(foreground);
-}
-
QColor FormatDescription::background() const
{
if (m_name == QLatin1String(Constants::C_TEXT))
diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h
index b0e4b2efba..ad87eb173c 100644
--- a/src/plugins/texteditor/fontsettingspage.h
+++ b/src/plugins/texteditor/fontsettingspage.h
@@ -60,14 +60,13 @@ public:
const QColor &foreground = Qt::black);
QString name() const;
-
QString trName() const;
-
QColor foreground() const;
- void setForeground(const QColor &foreground);
-
QColor background() const;
+ const Format &format() const { return m_format; }
+ Format &format() { return m_format; }
+
private:
QString m_name; // Name of the category
QString m_trName; // Displayed name of the category
diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp
index ca562d0df1..1631949a4d 100644
--- a/src/plugins/texteditor/texteditorsettings.cpp
+++ b/src/plugins/texteditor/texteditorsettings.cpp
@@ -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_PARENTHESES), tr("Parentheses")));
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
formatDescriptions.push_back(FormatDescription(QLatin1String(C_NUMBER), tr("Number"), Qt::darkBlue));