mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Show sample pressures in the cylinder equipment page
If we don't have any manually set pressure data, show the data from the samples instead. It uses an italic font for this case, mainly because I couldn't figure out how to gray things out. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bc24b9320f
commit
09ee8ece5c
1 changed files with 20 additions and 4 deletions
|
@ -78,9 +78,21 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const
|
|||
|
||||
cylinder_t *cyl = ¤t->cylinder[index.row()];
|
||||
switch (role) {
|
||||
case Qt::FontRole:
|
||||
ret = defaultModelFont();
|
||||
case Qt::FontRole: {
|
||||
QFont font = defaultModelFont();
|
||||
switch (index.column()) {
|
||||
case START:
|
||||
if (!cyl->start.mbar)
|
||||
font.setItalic(true);
|
||||
break;
|
||||
case END:
|
||||
if (!cyl->end.mbar)
|
||||
font.setItalic(true);
|
||||
break;
|
||||
}
|
||||
ret = font;
|
||||
break;
|
||||
}
|
||||
case Qt::TextAlignmentRole:
|
||||
ret = Qt::AlignHCenter;
|
||||
break;
|
||||
|
@ -112,11 +124,15 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const
|
|||
break;
|
||||
case START:
|
||||
if (cyl->start.mbar)
|
||||
ret = get_pressure_string(cyl->start, TRUE);
|
||||
ret = get_pressure_string(cyl->start, FALSE);
|
||||
else if (cyl->sample_start.mbar)
|
||||
ret = get_pressure_string(cyl->sample_start, FALSE);
|
||||
break;
|
||||
case END:
|
||||
if (cyl->end.mbar)
|
||||
ret = get_pressure_string(cyl->end, TRUE);
|
||||
ret = get_pressure_string(cyl->end, FALSE);
|
||||
else if (cyl->sample_end.mbar)
|
||||
ret = get_pressure_string(cyl->sample_end, FALSE);
|
||||
break;
|
||||
case O2:
|
||||
ret = percent_string(cyl->gasmix.o2);
|
||||
|
|
Loading…
Add table
Reference in a new issue