--Boundary-00=_KtIGHmLTvN2Oiqq Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, After attending the Munich devdays and hearing Aaron, Till and others swear when accidentally changing the font family when they intended to change the font size in konsole for presentations, I thought I'd fix it. It does seem that changing the font size is the most common action when using the font dialog. The first patch below simply sets the focus onto the size list when the font dialog is constructed. Whilst doing this I came across a TODO comment in the konsole source which said that it would be nice to restrict the font selection in konsole to fixed width fonts only. The second patch below achieves this. The api for restricting to fixed width fonts in KFontDialog and KFontChooser is not very nice or intuitive though. You can request fixed width fonts inthe constructor, but you can then (too easily) override this with future calls to the setFont function which takes a bool parameter specifying if you want only fixed fonts or not. However, I guess it is too late in the day to fix the API for this by adding a setRestrictFonts( const KFontChooser::DisplayFlags& flags ) member and removing the bool parameter from setFont(). If it's not too late and you would like me to do this, then please just ask. I'll leave it for somebody with more experience to commit/reject these patches. Kind regards, Sean Harmer --Boundary-00=_KtIGHmLTvN2Oiqq Content-Type: text/x-diff; charset="us-ascii"; name="AdjustFontSize.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="AdjustFontSize.patch" Index: kdeui/fonts/kfontchooser.cpp =================================================================== --- kdeui/fonts/kfontchooser.cpp (revision 726952) +++ kdeui/fonts/kfontchooser.cpp (working copy) @@ -405,6 +405,9 @@ KConfigGroup cg(KGlobal::config(), QLatin1String("General")); d->_k_showXLFDArea(cg.readEntry(QLatin1String("fontSelectorShowXLFD"), false)); + + // Set focus to the size list as this is the most commonly changed property + d->sizeListBox->setFocus(); } KFontChooser::~KFontChooser() --Boundary-00=_KtIGHmLTvN2Oiqq Content-Type: text/x-diff; charset="us-ascii"; name="KonsoleFixedFontsOnly.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="KonsoleFixedFontsOnly.patch" Index: apps/konsole/src/EditProfileDialog.cpp =================================================================== --- apps/konsole/src/EditProfileDialog.cpp (revision 726952) +++ apps/konsole/src/EditProfileDialog.cpp (working copy) @@ -961,14 +961,11 @@ } void EditProfileDialog::showFontDialog() { - //TODO Only permit selection of mono-spaced fonts. - // the KFontDialog API does not appear to have a means to do this - // at present. QFont currentFont = _ui->fontPreviewLabel->font(); - - KFontDialog* dialog = new KFontDialog(this); - dialog->setFont(currentFont); + KFontDialog* dialog = new KFontDialog(this, KFontChooser::FixedFontsOnly); + dialog->setFont(currentFont, true); + connect( dialog , SIGNAL(fontSelected(const QFont&)) , this , SLOT(fontSelected(const QFont&)) ); dialog->show(); } --Boundary-00=_KtIGHmLTvN2Oiqq--