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

View File

@ -130,7 +130,7 @@ namespace FireWallet
// Wait until the Node is connected before closing the splash
while (true)
{
string status = await APIGet("",false);
string status = await APIGet("", false);
if (status != "Error")
{
ss.CloseSplash();
@ -622,6 +622,10 @@ namespace FireWallet
[DllImport("user32.dll")]
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)
{
ResizeForm();
@ -633,9 +637,33 @@ namespace FireWallet
groupBoxDomains.Width = panelDomains.Width - 20;
groupBoxDomains.Left = 10;
groupBoxDomains.Height = panelDomains.Height - groupBoxDomains.Top - 10;
buttonNavSettings.Top = panelNav.Height - buttonNavSettings.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
#region Accounts
@ -1260,9 +1288,6 @@ namespace FireWallet
pictureBoxReceiveQR.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxReceiveQR.Width = panelRecieve.Width / 3;
pictureBoxReceiveQR.Left = (panelRecieve.Width - pictureBoxReceiveQR.Width) / 2;
}
private void buttonNavDomains_Click(object sender, EventArgs e)
{
@ -1355,7 +1380,8 @@ namespace FireWallet
if (UserSettings.ContainsKey("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";
if (Directory.Exists(bobPath))
@ -1436,7 +1462,7 @@ namespace FireWallet
{
labelSendingError.Show();
labelSendingError.Text = "Invalid Address";
AddLog("Invalid Address\n"+address);
AddLog("Invalid Address\n" + address);
}