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
This commit is contained in:
parent
ecfa8aa80f
commit
c410c673e1
1 changed files with 3 additions and 0 deletions
|
@ -98,10 +98,13 @@ KDesktopConfig::KDesktopConfig(QWidget *parent, const QVariantList &)
|
||||||
QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this);
|
QGroupBox *name_group = new QGroupBox(i18n("Desktop &Names"), this);
|
||||||
QVBoxLayout *vhoxlayout = new QVBoxLayout;
|
QVBoxLayout *vhoxlayout = new QVBoxLayout;
|
||||||
name_group->setLayout(vhoxlayout);
|
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++)
|
for(int i = 0; i < (maxDesktops/2); i++)
|
||||||
{
|
{
|
||||||
QHBoxLayout *hboxLayout = new QHBoxLayout;
|
QHBoxLayout *hboxLayout = new QHBoxLayout;
|
||||||
_nameLabel[i] = new QLabel(i18n("Desktop %1:", i+1), name_group);
|
_nameLabel[i] = new QLabel(i18n("Desktop %1:", i+1), name_group);
|
||||||
|
_nameLabel[i]->setMinimumWidth(labelWidth);
|
||||||
hboxLayout->addWidget(_nameLabel[i]);
|
hboxLayout->addWidget(_nameLabel[i]);
|
||||||
_nameInput[i] = new KLineEdit(name_group);
|
_nameInput[i] = new KLineEdit(name_group);
|
||||||
hboxLayout->addWidget(_nameInput[i]);
|
hboxLayout->addWidget(_nameInput[i]);
|
||||||
|
|
Loading…
Reference in a new issue