forked from qt-creator/qt-creator
TextEditors: use antialias setting in preview and app-/compile output
Change-Id: I992f6626881bccf432e36fc7fbdf646608218213 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -247,7 +247,9 @@ void FontSettings::setFontZoom(int zoom)
|
|||||||
|
|
||||||
QFont FontSettings::font() const
|
QFont FontSettings::font() const
|
||||||
{
|
{
|
||||||
return QFont(family(), fontSize());
|
QFont f(family(), fontSize());
|
||||||
|
f.setStyleStrategy(m_antialias ? QFont::PreferAntialias : QFont::NoAntialias);
|
||||||
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -351,6 +351,7 @@ QWidget *FontSettingsPage::widget()
|
|||||||
connect(d_ptr->m_ui->familyComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(fontFamilySelected(QString)));
|
connect(d_ptr->m_ui->familyComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(fontFamilySelected(QString)));
|
||||||
connect(d_ptr->m_ui->sizeComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(fontSizeSelected(QString)));
|
connect(d_ptr->m_ui->sizeComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(fontSizeSelected(QString)));
|
||||||
connect(d_ptr->m_ui->zoomSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fontZoomChanged()));
|
connect(d_ptr->m_ui->zoomSpinBox, SIGNAL(valueChanged(int)), this, SLOT(fontZoomChanged()));
|
||||||
|
connect(d_ptr->m_ui->antialias, SIGNAL(toggled(bool)), this, SLOT(antialiasChanged()));
|
||||||
connect(d_ptr->m_ui->schemeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(colorSchemeSelected(int)));
|
connect(d_ptr->m_ui->schemeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(colorSchemeSelected(int)));
|
||||||
connect(d_ptr->m_ui->copyButton, SIGNAL(clicked()), this, SLOT(copyColorScheme()));
|
connect(d_ptr->m_ui->copyButton, SIGNAL(clicked()), this, SLOT(copyColorScheme()));
|
||||||
connect(d_ptr->m_ui->deleteButton, SIGNAL(clicked()), this, SLOT(confirmDeleteColorScheme()));
|
connect(d_ptr->m_ui->deleteButton, SIGNAL(clicked()), this, SLOT(confirmDeleteColorScheme()));
|
||||||
@@ -419,6 +420,12 @@ void FontSettingsPage::fontZoomChanged()
|
|||||||
d_ptr->m_value.setFontZoom(d_ptr->m_ui->zoomSpinBox->value());
|
d_ptr->m_value.setFontZoom(d_ptr->m_ui->zoomSpinBox->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FontSettingsPage::antialiasChanged()
|
||||||
|
{
|
||||||
|
d_ptr->m_value.setAntialias(d_ptr->m_ui->antialias->isChecked());
|
||||||
|
d_ptr->m_ui->schemeEdit->setBaseFont(d_ptr->m_value.font());
|
||||||
|
}
|
||||||
|
|
||||||
void FontSettingsPage::colorSchemeSelected(int index)
|
void FontSettingsPage::colorSchemeSelected(int index)
|
||||||
{
|
{
|
||||||
bool readOnly = true;
|
bool readOnly = true;
|
||||||
@@ -591,7 +598,6 @@ void FontSettingsPage::apply()
|
|||||||
{
|
{
|
||||||
if (!d_ptr->m_ui) // page was never shown
|
if (!d_ptr->m_ui) // page was never shown
|
||||||
return;
|
return;
|
||||||
d_ptr->m_value.setAntialias(d_ptr->m_ui->antialias->isChecked());
|
|
||||||
|
|
||||||
if (d_ptr->m_value.colorScheme() != d_ptr->m_ui->schemeEdit->colorScheme()) {
|
if (d_ptr->m_value.colorScheme() != d_ptr->m_ui->schemeEdit->colorScheme()) {
|
||||||
// Update the scheme and save it under the name it already has
|
// Update the scheme and save it under the name it already has
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ private slots:
|
|||||||
void fontFamilySelected(const QString &family);
|
void fontFamilySelected(const QString &family);
|
||||||
void fontSizeSelected(const QString &sizeString);
|
void fontSizeSelected(const QString &sizeString);
|
||||||
void fontZoomChanged();
|
void fontZoomChanged();
|
||||||
|
void antialiasChanged();
|
||||||
void colorSchemeSelected(int index);
|
void colorSchemeSelected(int index);
|
||||||
void copyColorScheme();
|
void copyColorScheme();
|
||||||
void copyColorScheme(const QString &name);
|
void copyColorScheme(const QString &name);
|
||||||
|
|||||||
Reference in New Issue
Block a user