From c410c673e11979a3f5a115847e91ec34c4099c3d Mon Sep 17 00:00:00 2001 From: Urs Wolfer Date: Sun, 8 Jun 2008 11:25:38 +0000 Subject: [PATCH] ensure that all label will have the same width (with one or two numbers, e.g. 1, 99). otherwise the layout looks a bit broken. svn path=/trunk/KDE/kdebase/workspace/; revision=818342 --- kcmkwin/kwindesktop/desktop.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kcmkwin/kwindesktop/desktop.cpp b/kcmkwin/kwindesktop/desktop.cpp index b6f7a181e6..c00235dc8a 100644 --- a/kcmkwin/kwindesktop/desktop.cpp +++ b/kcmkwin/kwindesktop/desktop.cpp @@ -98,10 +98,13 @@ KDesktopConfig::KDesktopConfig(QWidget *parent, const QVariantList &) QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this); QVBoxLayout *vhoxlayout = new QVBoxLayout; name_group->setLayout(vhoxlayout); + QFontMetrics fm(label->font()); + int labelWidth = fm.width(i18n("Desktop %1:", 10)); // be sure that all label will have the same width (with one or two numbers, e.g. 1, 99) for(int i = 0; i < (maxDesktops/2); i++) { QHBoxLayout *hboxLayout = new QHBoxLayout; _nameLabel[i] = new QLabel(i18n("Desktop %1:", i+1), name_group); + _nameLabel[i]->setMinimumWidth(labelWidth); hboxLayout->addWidget(_nameLabel[i]); _nameInput[i] = new KLineEdit(name_group); hboxLayout->addWidget(_nameInput[i]);