- Introdotti nuovi controlli moderni (es. ModernButton, ModernDataGridView). - Aggiunto il tema scuro con colori, font e spaziature uniformi. - Aggiornati `Main.Designer.cs` e `Main.cs` per utilizzare i nuovi controlli. - Rimossi controlli e metodi obsoleti (es. ProgressDialog). - Migliorati layout, dimensioni e testi per una migliore usabilità. - Aggiunti metodi helper per configurazioni rapide nei controlli. - Implementato design modulare per una maggiore manutenibilità.
55 lines
1.7 KiB
C#
55 lines
1.7 KiB
C#
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace BettingPredictor.UI.Controls
|
|
{
|
|
/// <summary>
|
|
/// ProgressBar moderna con tema scuro e animazioni fluide
|
|
/// </summary>
|
|
public class ModernProgressBar : ProgressBar
|
|
{
|
|
public ModernProgressBar()
|
|
{
|
|
// Configurazione base
|
|
SetStyle(ControlStyles.UserPaint |
|
|
ControlStyles.AllPaintingInWmPaint |
|
|
ControlStyles.OptimizedDoubleBuffer, true);
|
|
|
|
Height = 6;
|
|
BackColor = ModernTheme.Colors.TertiaryBackground;
|
|
ForeColor = ModernTheme.Colors.AccentPrimary;
|
|
}
|
|
|
|
protected override void OnPaint(PaintEventArgs e)
|
|
{
|
|
Rectangle rect = ClientRectangle;
|
|
Graphics g = e.Graphics;
|
|
|
|
// Disegna il background
|
|
using (SolidBrush brush = new SolidBrush(ModernTheme.Colors.TertiaryBackground))
|
|
{
|
|
g.FillRectangle(brush, rect);
|
|
}
|
|
|
|
// Calcola la larghezza del progresso
|
|
int progressWidth = (int)(rect.Width * ((double)Value / Maximum));
|
|
|
|
// Disegna la barra di progresso
|
|
if (progressWidth > 0)
|
|
{
|
|
Rectangle progressRect = new Rectangle(rect.X, rect.Y, progressWidth, rect.Height);
|
|
using (SolidBrush brush = new SolidBrush(ForeColor))
|
|
{
|
|
g.FillRectangle(brush, progressRect);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SetProgressColor(Color color)
|
|
{
|
|
ForeColor = color;
|
|
Invalidate();
|
|
}
|
|
}
|
|
}
|