diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-16 12:33:27 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-16 12:33:27 -0300 |
commit | f9b4c6b889e2444533af1baabdee3687020c1e7b (patch) | |
tree | bb4ebc2d6d5b14ae6042c060f91dbca18fc0a1d0 /qt-ui/maintab.cpp | |
parent | 349a084496b694b4760f32bdf4d7b8caf2e8b3af (diff) | |
download | subsurface-f9b4c6b889e2444533af1baabdee3687020c1e7b.tar.gz |
Better handling of default sizes on the Cylinder and Weight widgets
Better handling of default sizes on the Cylinder and weight widgets,
the weigth widget didn't had a CSS applied so it looked odd compared
to the cylinder one, also the default behavior for the combobox delegate
didn't worked very well with the css applied, being too small.
this patch fixes that.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index ea1687a33..6f63b3574 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -79,12 +79,15 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), connect(ui->cylinders, SIGNAL(clicked(QModelIndex)), ui->cylinders->model(), SLOT(remove(QModelIndex))); connect(ui->weights, SIGNAL(clicked(QModelIndex)), ui->weights->model(), SLOT(remove(QModelIndex))); + QFontMetrics metrics(defaultModelFont()); + ui->cylinders->setColumnWidth(CylindersModel::REMOVE, 24); - ui->cylinders->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); 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->horizontalHeader()->setResizeMode (WeightModel::REMOVE , QHeaderView::Fixed); + ui->weights->verticalHeader()->setDefaultSectionSize( metrics.height() +8 ); ui->weights->setItemDelegateForColumn(WeightModel::TYPE, new WSInfoDelegate()); } |