2024-10-16 11:09:44 +02:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Windows.Forms;
|
2024-08-26 10:04:35 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Flowframes.Forms
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class SplashForm : Form
|
|
|
|
|
|
{
|
2024-10-16 11:09:44 +02:00
|
|
|
|
public enum TextSize { Small, Medium, Large }
|
|
|
|
|
|
private static readonly string[] fontPresets = { "Yu Gothic UI, 14pt", "Yu Gothic UI, 18pt", "Yu Gothic UI, 21.75pt" };
|
2024-10-16 10:26:05 +02:00
|
|
|
|
|
2024-10-16 13:50:26 +02:00
|
|
|
|
public SplashForm(string status = "", bool topMost = true, TextSize textSize = TextSize.Large, bool show = true)
|
2024-08-26 10:04:35 +02:00
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2024-10-16 10:26:05 +02:00
|
|
|
|
SetStatus(status);
|
2024-10-16 11:09:44 +02:00
|
|
|
|
TopMost = topMost;
|
|
|
|
|
|
statusLabel.Font = (Font)new FontConverter().ConvertFromInvariantString(fontPresets[(int)textSize]);
|
2024-10-16 13:50:26 +02:00
|
|
|
|
|
|
|
|
|
|
if (show)
|
|
|
|
|
|
{
|
|
|
|
|
|
Show();
|
|
|
|
|
|
}
|
2024-08-26 10:04:35 +02:00
|
|
|
|
}
|
2024-09-28 21:33:36 +02:00
|
|
|
|
|
|
|
|
|
|
private void SplashForm_Load(object sender, System.EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!Program.CmdMode)
|
|
|
|
|
|
{
|
|
|
|
|
|
Opacity = 1f;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-16 10:26:05 +02:00
|
|
|
|
|
|
|
|
|
|
public void SetStatus(string status)
|
|
|
|
|
|
{
|
|
|
|
|
|
statusLabel.Text = status;
|
|
|
|
|
|
}
|
2024-08-26 10:04:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|