Make SplashForm more flexible, cleanup

This commit is contained in:
N00MKRAD
2024-10-16 10:26:05 +02:00
parent 4cc392a56d
commit a5ac086364
5 changed files with 28 additions and 22 deletions

View File

@@ -43,10 +43,6 @@ namespace Flowframes
var optsSet = new OptionSet
{
// {
// "c|console", "Show console",
// v => ShowConsole = v != null
// },
{
"np|no_python", "Disable Python implementations",
v => DisablePython = v != null

View File

@@ -52,7 +52,8 @@ namespace Flowframes.Forms.Main
{
InitializeComponent();
new SplashForm().Show();
var splash = new SplashForm("Starting Flowframes...");
splash.Show();
if (Program.CmdMode)
{

View File

@@ -28,22 +28,22 @@
/// </summary>
private void InitializeComponent()
{
this.loadingTextLabel = new System.Windows.Forms.Label();
this.statusLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// loadingTextLabel
// statusLabel
//
this.loadingTextLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.loadingTextLabel.Font = new System.Drawing.Font("Yu Gothic UI", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.loadingTextLabel.ForeColor = System.Drawing.Color.White;
this.loadingTextLabel.Location = new System.Drawing.Point(0, 0);
this.loadingTextLabel.Margin = new System.Windows.Forms.Padding(3, 0, 3, 10);
this.loadingTextLabel.Name = "loadingTextLabel";
this.loadingTextLabel.Size = new System.Drawing.Size(480, 220);
this.loadingTextLabel.TabIndex = 2;
this.loadingTextLabel.Text = "Starting Flowframes...";
this.loadingTextLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.loadingTextLabel.UseWaitCursor = true;
this.statusLabel.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusLabel.Font = new System.Drawing.Font("Yu Gothic UI", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.statusLabel.ForeColor = System.Drawing.Color.White;
this.statusLabel.Location = new System.Drawing.Point(0, 0);
this.statusLabel.Margin = new System.Windows.Forms.Padding(3, 0, 3, 10);
this.statusLabel.Name = "statusLabel";
this.statusLabel.Size = new System.Drawing.Size(480, 220);
this.statusLabel.TabIndex = 2;
this.statusLabel.Text = "Starting Flowframes...";
this.statusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.statusLabel.UseWaitCursor = true;
//
// SplashForm
//
@@ -51,7 +51,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32)))));
this.ClientSize = new System.Drawing.Size(480, 220);
this.Controls.Add(this.loadingTextLabel);
this.Controls.Add(this.statusLabel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(480, 220);
@@ -72,6 +72,6 @@
#endregion
private System.Windows.Forms.Label loadingTextLabel;
public System.Windows.Forms.Label statusLabel;
}
}

View File

@@ -4,9 +4,13 @@ namespace Flowframes.Forms
{
public partial class SplashForm : Form
{
public SplashForm()
public static SplashForm Inst;
public SplashForm(string status = "")
{
Inst = this;
InitializeComponent();
SetStatus(status);
}
private void SplashForm_Load(object sender, System.EventArgs e)
@@ -16,5 +20,10 @@ namespace Flowframes.Forms
Opacity = 1f;
}
}
public void SetStatus(string status)
{
statusLabel.Text = status;
}
}
}

View File

@@ -43,7 +43,7 @@ namespace Flowframes.Os
string name = device.GetProperties().DeviceName;
VkDevices.Add(new VkDevice { Id = idx, Name = name, ComputeQueueCount = compQueues });
Logger.Log($"[VK] Found Vulkan device: {VkDevices.Last()} ({compQueues} Compute Queues)", true);
Logger.Log($"[VK] Found Vulkan device: {VkDevices.Last()}", true);
}
// Clean up Vulkan resources