mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
dffd2857f6
commit
0c9d71234f
1 changed files with 8 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue