fix: Italian labels + section title style + double header row height in dividend renderer

This commit is contained in:
2026-03-23 17:05:39 +01:00
parent 15a4034a77
commit bd51bb4d26

View File

@@ -35,9 +35,21 @@ public class DividendSectionRenderer
private static readonly string[] Col2Headers = private static readonly string[] Col2Headers =
[ [
"", "Strike", "Last", "% Perf.", "", // Nome (nessuna sub-label)
"Barr.Cap.", "Buf.Cap.", "Trig.CPN", "Buf.CPN", "Trig.AC", "Livello Iniziale", // Strike
"Data Stacco", "Data Pag.", "Importo", "Rend.", "Imp.Fut.", "Rend.Fut.", "Ultimo Prezzo", // Last
"% Perf.", // % Perf. (invariato)
"Barriera Capitale", // Barr.Cap.
"Protezione Capitale", // Buf.Cap.
"Livello Cedola", // Trig.CPN
"Protezione Cedola", // Buf.CPN
"Livello Richiamo Anticipato", // Trig.AC
"Data Stacco", // (invariato)
"Data Pagamento", // Data Pag.
"Importo", // (invariato)
"Rendimento", // Rend.
"Importo Futuro", // Imp.Fut.
"Rendimento Futuro", // Rend.Fut.
]; ];
// Indici colonne soggette a colore performance (0-based) // Indici colonne soggette a colore performance (0-based)
@@ -65,14 +77,12 @@ public class DividendSectionRenderer
float x0 = PdfTheme.PageMargin; float x0 = PdfTheme.PageMargin;
float y = PdfTheme.PageMargin; float y = PdfTheme.PageMargin;
// ── Titolo ──────────────────────────────────────────────────── // ── Titolo stile DrawSectionLabel ─────────────────────────────
g.DrawString("Sottostanti e Dividendi", PdfTheme.Title, PdfTheme.AccentBlueBrush, float rh0 = PdfTheme.RowHeight;
new RectangleF(x0, y, w, 20f)); g.DrawRectangle(PdfTheme.TableHeaderBrush, new RectangleF(x0, y, w, rh0));
y += 20f + 4f; g.DrawString("Sottostanti e Dividendi", PdfTheme.TableBold, PdfBrushes.White,
new RectangleF(x0 + 4f, y + 2f, w - 8f, rh0));
// ── Linea separatrice ───────────────────────────────────────── y += rh0 + 4f;
g.DrawLine(PdfTheme.AccentBluePen, new PointF(x0, y), new PointF(x0 + w, y));
y += 6f;
// ── Calcolo fattore scala su larghezza reale ────────────────── // ── Calcolo fattore scala su larghezza reale ──────────────────
float totalNominal = ColWidths.Sum(); float totalNominal = ColWidths.Sum();
@@ -84,7 +94,7 @@ public class DividendSectionRenderer
DrawHeader(g, x0, y, cw, rh); DrawHeader(g, x0, y, cw, rh);
y += rh * 2; y += rh * 3;
// ── Tabella dati ────────────────────────────────────────────── // ── Tabella dati ──────────────────────────────────────────────
DrawDataGrid(g, data, x0, y, cw); DrawDataGrid(g, data, x0, y, cw);
@@ -127,13 +137,13 @@ public class DividendSectionRenderer
for (int i = 0; i < cw.Length; i++) for (int i = 0; i < cw.Length; i++)
{ {
var bg = i >= 9 ? DarkBlueBrush : accentBrush; var bg = i >= 9 ? DarkBlueBrush : accentBrush;
DrawHeaderCell(g, cx, y + rh, cw[i], rh, Col2Headers[i], bg, whiteBrush, headerFont); DrawHeaderCell(g, cx, y + rh, cw[i], rh * 2, Col2Headers[i], bg, whiteBrush, headerFont);
cx += cw[i]; cx += cw[i];
} }
// ── Separatore verticale tra col 8 e col 9 ──────────────────── // ── Separatore verticale tra col 8 e col 9 ────────────────────
float sepX = x0 + cw.Take(9).Sum(); float sepX = x0 + cw.Take(9).Sum();
g.DrawLine(SeparatorPen, new PointF(sepX, y), new PointF(sepX, y + rh * 2)); g.DrawLine(SeparatorPen, new PointF(sepX, y), new PointF(sepX, y + rh * 3));
} }
private static void DrawHeaderCell(PdfGraphics g, float x, float y, float w, float h, private static void DrawHeaderCell(PdfGraphics g, float x, float y, float w, float h,