src/EditProductTab6.cpp

changeset 476
29487eac1183
parent 464
1fed3ff9a64e
child 478
a3653722b0d6
--- a/src/EditProductTab6.cpp	Wed Jan 25 13:11:51 2023 +0100
+++ b/src/EditProductTab6.cpp	Wed Jan 25 16:12:16 2023 +0100
@@ -1059,6 +1059,20 @@
     item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
     ui->yeastsTable->setItem(product->yeasts_row, 8, item);
 
+    if (product->yeasts.at(product->yeasts_row).use != YEAST_USE_BOTTLE && product->yeasts.at(product->yeasts_row).sta1) {
+	QWidget *pWidget = new QWidget();
+	QLabel *label = new QLabel;
+	label->setPixmap(QPixmap(":icons/silk/tick.png"));
+	QHBoxLayout *pLayout = new QHBoxLayout(pWidget);
+	pLayout->addWidget(label);
+	pLayout->setAlignment(Qt::AlignCenter);
+	pLayout->setContentsMargins(0, 0, 0, 0);
+	pWidget->setLayout(pLayout);
+	ui->yeastsTable->setCellWidget(product->yeasts_row, 9, pWidget);
+    } else {
+	ui->yeastsTable->removeCellWidget(product->yeasts_row, 9);
+    }
+
     if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_LIQUID)
 	item = new QTableWidgetItem(QString("%1 pack").arg(product->yeasts.at(product->yeasts_row).amount, 1, 'f', 0, '0'));
     else if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRY || product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRIED)
@@ -1066,7 +1080,7 @@
     else
 	item = new QTableWidgetItem(QString("%1 ml").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0'));
     item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
-    ui->yeastsTable->setItem(product->yeasts_row, 9, item);
+    ui->yeastsTable->setItem(product->yeasts_row, 10, item);
 
     /*
      * If there is no need for a starter, wipe it.

mercurial