summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2015-10-19 20:05:24 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-19 11:45:12 -0700
commit0c9d71234fd49e1924124e8898604d087b21792e (patch)
tree4172a1f275cd35d4a90c16ad46f7c93648434038
parentdffd2857f62ccbdb9a1329c4915717dbc60e0909 (diff)
downloadsubsurface-0c9d71234fd49e1924124e8898604d087b21792e.tar.gz
Show correct icon when only one gasmix in the list
When there is only one gasmix in the list we should show the icon that tells the user that they can't remove the last gasmix from the list. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-models/cylindermodel.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 8786f7889..8c9bee8b1 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -112,11 +112,17 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
break;
case Qt::DecorationRole:
if (index.column() == REMOVE)
- ret = trashIcon();
+ if (rowCount() > 1)
+ ret = trashIcon();
+ else
+ ret = trashForbiddenIcon();
break;
case Qt::SizeHintRole:
if (index.column() == REMOVE)
- ret = trashIcon().size();
+ if (rowCount() > 1)
+ ret = trashIcon();
+ else
+ ret = trashForbiddenIcon();
break;
case Qt::ToolTipRole: