src/PrinterDialog.cpp

changeset 336
e97f9e87d94b
parent 301
fe6346211b5b
child 340
b9af88bfe972
equal deleted inserted replaced
335:c4b4a2879bb8 336:e97f9e87d94b
65 const QColor mo_line( 210, 245, 255, 255); 65 const QColor mo_line( 210, 245, 255, 255);
66 const QColor line( 175, 175, 255, 255); // also y_line 66 const QColor line( 175, 175, 255, 255); // also y_line
67 const QColor w_line( 120, 255, 250, 255); 67 const QColor w_line( 120, 255, 250, 255);
68 68
69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")}); 69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")});
70 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" });
71 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 70 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
72 const QStringList cooling_method({"-", tr("Emersion chiller"), tr("Counterflow chiller"), tr("Au bain marie"), tr("Natural") }); 71 const QStringList cooling_method({"-", tr("Emersion chiller"), tr("Counterflow chiller"), tr("Au bain marie"), tr("Natural") });
73 72
74 painter.begin(printer); 73 painter.begin(printer);
75 qreal y = 0; 74 qreal y = 0;
365 painter.setPen(Qt::white); 364 painter.setPen(Qt::white);
366 painter.drawText(170, y+4, 90, 20, Qt::AlignLeft, QString("%1 EBC").arg(recipe->est_color, 1, 'f', 0)); 365 painter.drawText(170, y+4, 90, 20, Qt::AlignLeft, QString("%1 EBC").arg(recipe->est_color, 1, 'f', 0));
367 painter.drawText(260, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(recipe->st_color_min, 1, 'f', 0).arg(recipe->st_color_max, 1, 'f', 0)); 366 painter.drawText(260, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(recipe->st_color_min, 1, 'f', 0).arg(recipe->st_color_max, 1, 'f', 0));
368 painter.setPen(Qt::black); 367 painter.setPen(Qt::black);
369 painter.fillRect(405, y, 330, 20, c_line1); 368 painter.fillRect(405, y, 330, 20, c_line1);
370 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("IBU (") + ibu_method[recipe->ibu_method] + ")"); 369 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("IBU (") + g_ibu_method[recipe->ibu_method] + ")");
371 painter.drawText(555, y+4, 90, 20, Qt::AlignLeft, QString("%1").arg(recipe->est_ibu, 1, 'f', 1)); 370 painter.drawText(555, y+4, 90, 20, Qt::AlignLeft, QString("%1").arg(recipe->est_ibu, 1, 'f', 1));
372 painter.drawText(645, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(recipe->st_ibu_min, 1, 'f', 0).arg(recipe->st_ibu_max, 1, 'f', 0)); 371 painter.drawText(645, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(recipe->st_ibu_min, 1, 'f', 0).arg(recipe->st_ibu_max, 1, 'f', 0));
373 y += 40; 372 y += 40;
374 373
375 /* Fermentables */ 374 /* Fermentables */
746 painter.setPen(Qt::white); 745 painter.setPen(Qt::white);
747 painter.drawText(170, y+4, 90, 20, Qt::AlignLeft, QString("%1 EBC").arg(product->est_color, 1, 'f', 0)); 746 painter.drawText(170, y+4, 90, 20, Qt::AlignLeft, QString("%1 EBC").arg(product->est_color, 1, 'f', 0));
748 painter.drawText(260, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(product->st_color_min, 1, 'f', 0).arg(product->st_color_max, 1, 'f', 0)); 747 painter.drawText(260, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(product->st_color_min, 1, 'f', 0).arg(product->st_color_max, 1, 'f', 0));
749 painter.setPen(Qt::black); 748 painter.setPen(Qt::black);
750 painter.fillRect(405, y, 330, 20, c_line1); 749 painter.fillRect(405, y, 330, 20, c_line1);
751 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("IBU (") + ibu_method[product->ibu_method] + ")"); 750 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("IBU (") + g_ibu_method[product->ibu_method] + ")");
752 painter.drawText(555, y+4, 90, 20, Qt::AlignLeft, QString("%1").arg(product->est_ibu, 1, 'f', 1)); 751 painter.drawText(555, y+4, 90, 20, Qt::AlignLeft, QString("%1").arg(product->est_ibu, 1, 'f', 1));
753 painter.drawText(645, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(product->st_ibu_min, 1, 'f', 0).arg(product->st_ibu_max, 1, 'f', 0)); 752 painter.drawText(645, y+4, 90, 20, Qt::AlignLeft, QString("(%1 - %2)").arg(product->st_ibu_min, 1, 'f', 0).arg(product->st_ibu_max, 1, 'f', 0));
754 y += 20; 753 y += 20;
755 painter.fillRect( 20, y, 330, 20, c_line1); 754 painter.fillRect( 20, y, 330, 20, c_line1);
756 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Beer style")); 755 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Beer style"));

mercurial