mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make the columns have a sane default width for 'type'
Make the columns on Cylinders edit and Wheight Edit to have sane values for 'type', this is needed because the old behavior was to set it fixed size, and the default fixed size was silly. this calculates a good predefined value taking the font size in consideration. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
f9b4c6b889
commit
20849f014e
3 changed files with 31 additions and 3 deletions
|
@ -80,12 +80,16 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
|||
connect(ui->weights, SIGNAL(clicked(QModelIndex)), ui->weights->model(), SLOT(remove(QModelIndex)));
|
||||
|
||||
QFontMetrics metrics(defaultModelFont());
|
||||
QFontMetrics metrics2(font());
|
||||
|
||||
ui->cylinders->setColumnWidth(CylindersModel::REMOVE, 24);
|
||||
ui->cylinders->setColumnWidth(CylindersModel::TYPE, metrics2.width(TankInfoModel::instance()->biggerString()) + 20);
|
||||
ui->cylinders->horizontalHeader()->setResizeMode(CylindersModel::REMOVE, QHeaderView::Fixed);
|
||||
ui->cylinders->verticalHeader()->setDefaultSectionSize( metrics.height() +8 );
|
||||
ui->cylinders->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate());
|
||||
|
||||
ui->weights->setColumnWidth(WeightModel::REMOVE, 24);
|
||||
ui->weights->setColumnWidth(WeightModel::TYPE, metrics2.width(WSInfoModel::instance()->biggerString()) + 20);
|
||||
ui->weights->horizontalHeader()->setResizeMode (WeightModel::REMOVE , QHeaderView::Fixed);
|
||||
ui->weights->verticalHeader()->setDefaultSectionSize( metrics.height() +8 );
|
||||
ui->weights->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue