Commit 69989714 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Port KFontDialog to QFontDialog

1. Sample text is no longer changed
2. Fonts are no long previewed in the terminal
3. It would be nice to disable/hide the "Effects" portion
parent 4cc527b3
......@@ -35,11 +35,12 @@
#include <QCompleter>
#include <QFileSystemModel>
#include <QtCore/QUrl>
#include <QFontDialog>
#include <QDebug>
// KDE
#include <KCodecAction>
#include <KFontDialog>
#include <KDialog>
#include <KIconDialog>
#include <KFileDialog>
#include <KUrlCompletion>
......@@ -1210,30 +1211,15 @@ void EditProfileDialog::fontSelected(const QFont& aFont)
void EditProfileDialog::showFontDialog()
QString sampleText = QString("ell 'lL', one '1', little eye 'i', big eye");
sampleText += QString("'I', lL1iI, Zero '0', little oh 'o', big oh 'O', 0oO");
sampleText += QString("`~!@#$%^&*()_+-=[]\\{}|:\";'<>?,./");
sampleText += QString("0123456789");
sampleText += QString("\nThe Quick Brown Fox Jumps Over The Lazy Dog\n");
sampleText += i18n("--- Type anything in this box ---");
QFont currentFont = _ui->fontPreviewLabel->font();
QWeakPointer<KFontDialog> dialog = new KFontDialog(this, KFontChooser::FixedFontsOnly);>setWindowTitle(i18n("Select Fixed Width Font"));>setFont(currentFont, true);
bool result;
currentFont = QFontDialog::getFont(&result, currentFont, this,
i18n("Select Fixed Width Font"),
if (!result) return;
// TODO (hindenburg): When is
// committed, change the below.
// Use text more fitting to show font differences in a terminal
QList<KFontChooser*> chooserList =>findChildren<KFontChooser*>();
if (!chooserList.isEmpty())>setSampleText(sampleText);
connect(, &KFontDialog::fontSelected, this, &Konsole::EditProfileDialog::fontSelected);
if (>exec() == QDialog::Rejected)
void EditProfileDialog::setFontSize(double pointSize)
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