Default equipment column widths

Dirk Hohndel dirk at hohndel.org
Thu Jun 20 08:13:26 PDT 2013


On Thu, 2013-06-20 at 11:59 -0300, Tomaz Canabrava wrote:
> On Thu, Jun 20, 2013 at 10:50 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
> > On Thu, 2013-06-20 at 09:15 +0200, Henrik Brautaset Aronsen wrote:
> >> The column widths in the equipment tab on MacOSX are too narrow.  Is
> >> it that way on Linux as well?
> >>
> >>
> >> http://imgbin.ca/image.php?di=2WBS
> >>
> >> http://imgbin.ca/image.php?di=PKZB
> >>
> >>
> 
> 
> Bummer - I tougth I fixed that.

It appears to be this routine...

void MainTab::initialUiSetup()
{
	QSettings s;
	s.beginGroup("MainTab");
	s.beginGroup("Cylinders");
	for (int i = 0; i < CylindersModel::COLUMNS; i++) {
		QVariant width = s.value(QString("colwidth%1").arg(i));
		if (width.isValid())
			ui->cylinders->setColumnWidth(i, width.toInt());
		else
			ui->cylinders->resizeColumnToContents(i);
	}
	s.endGroup();
	s.beginGroup("Weights");
	for (int i = 0; i < WeightModel::COLUMNS; i++) {
		QVariant width = s.value(QString("colwidth%1").arg(i));
		if (width.isValid())
			ui->weights->setColumnWidth(i, width.toInt());
		else
			ui->weights->resizeColumnToContents(i);
	}
	s.endGroup();

}

So this seems wrong on two levels.

a) it uses the same "colwidth" for Cylinders and Weights (which makes
very limited sense)
b) this colwidth is designed to be the colwidth of the divelist (and is
only ever used in that context).

What I think we need to do is define separate cylColwidth and
weightColwidth (and make sure that we actually save those once the user
resizes the columns).

Or we drop saving this to the settings at all and simply determine the
size of the columns from the maximum width of all the possible
completions for each column...

/D



More information about the subsurface mailing list