Fixed TypeWidget font to monospace. (#1755)

Also the tab width was set to 4 chars.
This commit is contained in:
xarkes 2019-09-07 16:26:25 +02:00 committed by GitHub
parent b4535227cf
commit 1d1e2af9c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,10 @@ TypesInteractionDialog::TypesInteractionDialog(QWidget *parent, bool readOnly) :
ui(new Ui::TypesInteractionDialog) ui(new Ui::TypesInteractionDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
QFont font = Config()->getFont();
ui->plainTextEdit->setFont(font);
ui->plainTextEdit->setPlainText(""); ui->plainTextEdit->setPlainText("");
ui->plainTextEdit->setTabStopDistance(4 * QFontMetrics(font).horizontalAdvance(' '));
syntaxHighLighter = Config()->createSyntaxHighlighter(ui->plainTextEdit->document()); syntaxHighLighter = Config()->createSyntaxHighlighter(ui->plainTextEdit->document());
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
ui->plainTextEdit->setReadOnly(readOnly); ui->plainTextEdit->setReadOnly(readOnly);