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
icc-effect-5.14.5
Urs Wolfer 2008-06-08 11:25:38 +00:00
parent ecfa8aa80f
commit c410c673e1
1 changed files with 3 additions and 0 deletions

View File

@ -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]);