Transizione completa da WinForms a WPF con interfaccia moderna (sidebar, pagine, palette Catppuccin Mocha). Aggiunta integrazione con The Racing API per le corse dei cavalli, inclusi nuovi moduli di backend e parsing dati. Introdotti componenti UI personalizzati (CardPanel, ModernButton, ModernProgressBar, NavButton, ModernTheme) per un look coerente e moderno. Gestione avanzata delle impostazioni, esportazione CSV migliorata, refactoring della logica di business e maggiore robustezza nelle chiamate API. Aggiunti stub CsvHelper e file di progetto di backup per facilitare la compatibilità e la migrazione.
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using System.Drawing;
|
|
using System.Drawing.Drawing2D;
|
|
using System.Windows.Forms;
|
|
|
|
namespace BettingPredictor.UI
|
|
{
|
|
/// <summary>
|
|
/// Pannello con angoli arrotondati e ombra simulata per stile card moderno
|
|
/// </summary>
|
|
internal class CardPanel : Panel
|
|
{
|
|
public int Radius { get; set; } = ModernTheme.CardRadius;
|
|
|
|
public CardPanel()
|
|
{
|
|
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw, true);
|
|
BackColor = Color.Transparent;
|
|
Padding = new Padding(ModernTheme.CardPadding);
|
|
}
|
|
|
|
protected override void OnPaint(PaintEventArgs e)
|
|
{
|
|
var g = e.Graphics;
|
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
|
|
|
// Pulisci sfondo
|
|
using (var bgBrush = new SolidBrush(Parent?.BackColor ?? ModernTheme.ContentBackground))
|
|
g.FillRectangle(bgBrush, ClientRectangle);
|
|
|
|
var cardRect = new Rectangle(0, 0, Width - 2, Height - 2);
|
|
using (var path = ModernTheme.GetRoundedRectPath(cardRect, Radius))
|
|
{
|
|
using (var brush = new SolidBrush(ModernTheme.CardBackground))
|
|
g.FillPath(brush, path);
|
|
using (var pen = new Pen(ModernTheme.CardBorder, 1))
|
|
g.DrawPath(pen, path);
|
|
}
|
|
}
|
|
}
|
|
}
|