main: Fixed resizing form

This commit is contained in:
Nathan Woodburn 2023-06-19 11:31:43 +10:00
parent 429cf0d67b
commit ac2aa06888
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 54 additions and 27 deletions

View File

@ -45,6 +45,8 @@ namespace FireWallet
githubToolStripMenuItem = new ToolStripMenuItem(); githubToolStripMenuItem = new ToolStripMenuItem();
websiteToolStripMenuItem = new ToolStripMenuItem(); websiteToolStripMenuItem = new ToolStripMenuItem();
supportDiscordServerToolStripMenuItem = new ToolStripMenuItem(); supportDiscordServerToolStripMenuItem = new ToolStripMenuItem();
toolStripSeparator1 = new ToolStripSeparator();
otherProjectsToolStripMenuItem = new ToolStripMenuItem();
timerNodeStatus = new System.Windows.Forms.Timer(components); timerNodeStatus = new System.Windows.Forms.Timer(components);
panelaccount = new Panel(); panelaccount = new Panel();
groupBoxaccount = new GroupBox(); groupBoxaccount = new GroupBox();
@ -124,8 +126,6 @@ namespace FireWallet
textBoxExAddr = new TextBox(); textBoxExAddr = new TextBox();
labelSettings4 = new Label(); labelSettings4 = new Label();
textBoxExTX = new TextBox(); textBoxExTX = new TextBox();
toolStripSeparator1 = new ToolStripSeparator();
otherProjectsToolStripMenuItem = new ToolStripMenuItem();
statusStripmain.SuspendLayout(); statusStripmain.SuspendLayout();
panelaccount.SuspendLayout(); panelaccount.SuspendLayout();
groupBoxaccount.SuspendLayout(); groupBoxaccount.SuspendLayout();
@ -233,6 +233,18 @@ namespace FireWallet
supportDiscordServerToolStripMenuItem.Text = "Support Discord Server"; supportDiscordServerToolStripMenuItem.Text = "Support Discord Server";
supportDiscordServerToolStripMenuItem.Click += supportDiscordServerToolStripMenuItem_Click; supportDiscordServerToolStripMenuItem.Click += supportDiscordServerToolStripMenuItem_Click;
// //
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(191, 6);
//
// otherProjectsToolStripMenuItem
//
otherProjectsToolStripMenuItem.Name = "otherProjectsToolStripMenuItem";
otherProjectsToolStripMenuItem.Size = new Size(194, 22);
otherProjectsToolStripMenuItem.Text = "Other Projects";
otherProjectsToolStripMenuItem.Click += otherProjectsToolStripMenuItem_Click;
//
// timerNodeStatus // timerNodeStatus
// //
timerNodeStatus.Enabled = true; timerNodeStatus.Enabled = true;
@ -437,7 +449,7 @@ namespace FireWallet
panelPortfolio.Controls.Add(groupBoxTransactions); panelPortfolio.Controls.Add(groupBoxTransactions);
panelPortfolio.Controls.Add(groupBoxinfo); panelPortfolio.Controls.Add(groupBoxinfo);
panelPortfolio.Controls.Add(groupBoxbalance); panelPortfolio.Controls.Add(groupBoxbalance);
panelPortfolio.Location = new Point(1065, 80); panelPortfolio.Location = new Point(140, 35);
panelPortfolio.Name = "panelPortfolio"; panelPortfolio.Name = "panelPortfolio";
panelPortfolio.Size = new Size(956, 538); panelPortfolio.Size = new Size(956, 538);
panelPortfolio.TabIndex = 7; panelPortfolio.TabIndex = 7;
@ -576,7 +588,7 @@ namespace FireWallet
panelSend.Controls.Add(labelSendingTo); panelSend.Controls.Add(labelSendingTo);
panelSend.Controls.Add(labelSendPrompt); panelSend.Controls.Add(labelSendPrompt);
panelSend.Controls.Add(labelHIPArrow); panelSend.Controls.Add(labelHIPArrow);
panelSend.Location = new Point(138, 33); panelSend.Location = new Point(1041, 235);
panelSend.Name = "panelSend"; panelSend.Name = "panelSend";
panelSend.Size = new Size(974, 521); panelSend.Size = new Size(974, 521);
panelSend.TabIndex = 2; panelSend.TabIndex = 2;
@ -794,7 +806,7 @@ namespace FireWallet
panelDomains.Controls.Add(groupBoxDomains); panelDomains.Controls.Add(groupBoxDomains);
panelDomains.Controls.Add(labelDomainSearch); panelDomains.Controls.Add(labelDomainSearch);
panelDomains.Controls.Add(textBoxDomainSearch); panelDomains.Controls.Add(textBoxDomainSearch);
panelDomains.Location = new Point(120, 48); panelDomains.Location = new Point(1122, 35);
panelDomains.Name = "panelDomains"; panelDomains.Name = "panelDomains";
panelDomains.Size = new Size(920, 536); panelDomains.Size = new Size(920, 536);
panelDomains.TabIndex = 18; panelDomains.TabIndex = 18;
@ -1093,18 +1105,6 @@ namespace FireWallet
textBoxExTX.Size = new Size(307, 29); textBoxExTX.Size = new Size(307, 29);
textBoxExTX.TabIndex = 1; textBoxExTX.TabIndex = 1;
// //
// toolStripSeparator1
//
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new Size(191, 6);
//
// otherProjectsToolStripMenuItem
//
otherProjectsToolStripMenuItem.Name = "otherProjectsToolStripMenuItem";
otherProjectsToolStripMenuItem.Size = new Size(194, 22);
otherProjectsToolStripMenuItem.Text = "Other Projects";
otherProjectsToolStripMenuItem.Click += otherProjectsToolStripMenuItem_Click;
//
// MainForm // MainForm
// //
AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
@ -1124,6 +1124,7 @@ namespace FireWallet
Text = "FireWallet"; Text = "FireWallet";
FormClosing += MainForm_Closing; FormClosing += MainForm_Closing;
Load += MainForm_Load; Load += MainForm_Load;
ResizeEnd += MainForm_ResizeEnd;
Resize += Form1_Resize; Resize += Form1_Resize;
statusStripmain.ResumeLayout(false); statusStripmain.ResumeLayout(false);
statusStripmain.PerformLayout(); statusStripmain.PerformLayout();

View File

@ -71,7 +71,7 @@ namespace FireWallet
else else
{ {
// Show splash screen // Show splash screen
ss.Show(); ss.Show();
splash = true; splash = true;
} }
// Record time // Record time
@ -130,7 +130,7 @@ namespace FireWallet
// Wait until the Node is connected before closing the splash // Wait until the Node is connected before closing the splash
while (true) while (true)
{ {
string status = await APIGet("",false); string status = await APIGet("", false);
if (status != "Error") if (status != "Error")
{ {
ss.CloseSplash(); ss.CloseSplash();
@ -622,6 +622,10 @@ namespace FireWallet
[DllImport("user32.dll")] [DllImport("user32.dll")]
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
} }
private void MainForm_ResizeEnd(object sender, EventArgs e)
{
ResizeForm();
}
private void Form1_Resize(object sender, EventArgs e) private void Form1_Resize(object sender, EventArgs e)
{ {
ResizeForm(); ResizeForm();
@ -633,9 +637,33 @@ namespace FireWallet
groupBoxDomains.Width = panelDomains.Width - 20; groupBoxDomains.Width = panelDomains.Width - 20;
groupBoxDomains.Left = 10; groupBoxDomains.Left = 10;
groupBoxDomains.Height = panelDomains.Height - groupBoxDomains.Top - 10; groupBoxDomains.Height = panelDomains.Height - groupBoxDomains.Top - 10;
buttonNavSettings.Top = panelNav.Height - buttonNavSettings.Height - 10; buttonNavSettings.Top = panelNav.Height - buttonNavSettings.Height - 10;
buttonSettingsSave.Top = panelSettings.Height - buttonSettingsSave.Height - 10; buttonSettingsSave.Top = panelSettings.Height - buttonSettingsSave.Height - 10;
groupBoxTransactions.Height = panelPortfolio.Height - groupBoxbalance.Height - 10;
// SEND Page
labelSendPrompt.Left = (panelSend.Width - labelSendPrompt.Width) / 2;
buttonSendHNS.Left = (panelSend.Width - buttonSendHNS.Width) / 2;
labelSendingTo.Left = (panelSend.Width - labelSendingTo.Width - textBoxSendingTo.Width) / 2;
labelSendingAmount.Left = labelSendingTo.Left;
textBoxSendingTo.Left = labelSendingTo.Left + labelSendingTo.Width + 10;
textBoxSendingAmount.Left = textBoxSendingTo.Left;
labelSendingMax.Left = labelSendingTo.Left;
labelSendingError.Left = textBoxSendingTo.Left + textBoxSendingTo.Width + 10;
labelSendingFee.Left = labelSendingTo.Left;
buttonSendMax.Left = textBoxSendingAmount.Left + textBoxSendingAmount.Width - buttonSendMax.Width;
checkBoxSendSubFee.Left = labelSendingTo.Left;
// RECEIVE Page
labelReceive1.Left = (panelRecieve.Width - labelReceive1.Width) / 2;
labelReceive2.Left = (panelRecieve.Width - labelReceive2.Width) / 2;
textBoxReceiveAddress.Left = (panelRecieve.Width - textBoxReceiveAddress.Width) / 2;
Size size = TextRenderer.MeasureText(textBoxReceiveAddress.Text, textBoxReceiveAddress.Font);
textBoxReceiveAddress.Width = size.Width + 10;
textBoxReceiveAddress.Left = (panelRecieve.Width - textBoxReceiveAddress.Width) / 2;
pictureBoxReceiveQR.Width = panelRecieve.Width / 3;
pictureBoxReceiveQR.Left = (panelRecieve.Width - pictureBoxReceiveQR.Width) / 2;
} }
#endregion #endregion
#region Accounts #region Accounts
@ -1260,9 +1288,6 @@ namespace FireWallet
pictureBoxReceiveQR.SizeMode = PictureBoxSizeMode.Zoom; pictureBoxReceiveQR.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxReceiveQR.Width = panelRecieve.Width / 3; pictureBoxReceiveQR.Width = panelRecieve.Width / 3;
pictureBoxReceiveQR.Left = (panelRecieve.Width - pictureBoxReceiveQR.Width) / 2; pictureBoxReceiveQR.Left = (panelRecieve.Width - pictureBoxReceiveQR.Width) / 2;
} }
private void buttonNavDomains_Click(object sender, EventArgs e) private void buttonNavDomains_Click(object sender, EventArgs e)
{ {
@ -1329,7 +1354,7 @@ namespace FireWallet
public string TLSA { get; set; } public string TLSA { get; set; }
private async void textBoxSendingTo_Leave(object sender, EventArgs e) private async void textBoxSendingTo_Leave(object sender, EventArgs e)
{ {
labelSendingError.Hide(); labelSendingError.Hide();
labelHIPArrow.Hide(); labelHIPArrow.Hide();
labelSendingHIPAddress.Hide(); labelSendingHIPAddress.Hide();
@ -1355,7 +1380,8 @@ namespace FireWallet
if (UserSettings.ContainsKey("hip-02-port")) if (UserSettings.ContainsKey("hip-02-port"))
{ {
port = int.Parse(UserSettings["hip-02-port"]); port = int.Parse(UserSettings["hip-02-port"]);
} else if (!HSD) }
else if (!HSD)
{ {
string bobPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Bob\\hsd_data"; string bobPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Bob\\hsd_data";
if (Directory.Exists(bobPath)) if (Directory.Exists(bobPath))
@ -1436,11 +1462,11 @@ namespace FireWallet
{ {
labelSendingError.Show(); labelSendingError.Show();
labelSendingError.Text = "Invalid Address"; labelSendingError.Text = "Invalid Address";
AddLog("Invalid Address\n"+address); AddLog("Invalid Address\n" + address);
} }
} }
} }