main: Updated theme dropdown and added new menu item for other projects.

- Changed foreach loop to update the foreground and background colors of ToolStripDropDownItems
- Added a new menu item "Other Projects" to the Help dropdown menu
- Created a new event handler method for the "Other Projects" menu item click action
This commit is contained in:
Nathan Woodburn 2023-06-17 13:47:47 +10:00
parent a024ce7afc
commit 90cc614ebf
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 63 additions and 34 deletions

View File

@ -95,6 +95,7 @@ namespace FireWallet
textBoxReceiveAddress = new TextBox(); textBoxReceiveAddress = new TextBox();
labelReceive1 = new Label(); labelReceive1 = new Label();
panelDomains = new Panel(); panelDomains = new Panel();
labelDomainSort = new Label();
comboBoxDomainSort = new ComboBox(); comboBoxDomainSort = new ComboBox();
buttonExportDomains = new Button(); buttonExportDomains = new Button();
groupBoxDomains = new GroupBox(); groupBoxDomains = new GroupBox();
@ -123,7 +124,8 @@ namespace FireWallet
textBoxExAddr = new TextBox(); textBoxExAddr = new TextBox();
labelSettings4 = new Label(); labelSettings4 = new Label();
textBoxExTX = new TextBox(); textBoxExTX = new TextBox();
labelDomainSort = new Label(); toolStripSeparator1 = new ToolStripSeparator();
otherProjectsToolStripMenuItem = new ToolStripMenuItem();
statusStripmain.SuspendLayout(); statusStripmain.SuspendLayout();
panelaccount.SuspendLayout(); panelaccount.SuspendLayout();
groupBoxaccount.SuspendLayout(); groupBoxaccount.SuspendLayout();
@ -201,7 +203,7 @@ namespace FireWallet
// toolStripDropDownButtonHelp // toolStripDropDownButtonHelp
// //
toolStripDropDownButtonHelp.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripDropDownButtonHelp.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripDropDownButtonHelp.DropDownItems.AddRange(new ToolStripItem[] { githubToolStripMenuItem, websiteToolStripMenuItem, supportDiscordServerToolStripMenuItem }); toolStripDropDownButtonHelp.DropDownItems.AddRange(new ToolStripItem[] { githubToolStripMenuItem, websiteToolStripMenuItem, supportDiscordServerToolStripMenuItem, toolStripSeparator1, otherProjectsToolStripMenuItem });
toolStripDropDownButtonHelp.Image = (Image)resources.GetObject("toolStripDropDownButtonHelp.Image"); toolStripDropDownButtonHelp.Image = (Image)resources.GetObject("toolStripDropDownButtonHelp.Image");
toolStripDropDownButtonHelp.ImageTransparentColor = Color.Magenta; toolStripDropDownButtonHelp.ImageTransparentColor = Color.Magenta;
toolStripDropDownButtonHelp.Margin = new Padding(20, 2, 0, 0); toolStripDropDownButtonHelp.Margin = new Padding(20, 2, 0, 0);
@ -798,6 +800,16 @@ namespace FireWallet
panelDomains.TabIndex = 18; panelDomains.TabIndex = 18;
panelDomains.Visible = false; panelDomains.Visible = false;
// //
// labelDomainSort
//
labelDomainSort.AutoSize = true;
labelDomainSort.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
labelDomainSort.Location = new Point(638, 15);
labelDomainSort.Name = "labelDomainSort";
labelDomainSort.Size = new Size(42, 21);
labelDomainSort.TabIndex = 12;
labelDomainSort.Text = "Sort:";
//
// comboBoxDomainSort // comboBoxDomainSort
// //
comboBoxDomainSort.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxDomainSort.DropDownStyle = ComboBoxStyle.DropDownList;
@ -1081,15 +1093,17 @@ namespace FireWallet
textBoxExTX.Size = new Size(307, 29); textBoxExTX.Size = new Size(307, 29);
textBoxExTX.TabIndex = 1; textBoxExTX.TabIndex = 1;
// //
// labelDomainSort // toolStripSeparator1
// //
labelDomainSort.AutoSize = true; toolStripSeparator1.Name = "toolStripSeparator1";
labelDomainSort.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point); toolStripSeparator1.Size = new Size(191, 6);
labelDomainSort.Location = new Point(638, 15); //
labelDomainSort.Name = "labelDomainSort"; // otherProjectsToolStripMenuItem
labelDomainSort.Size = new Size(42, 21); //
labelDomainSort.TabIndex = 12; otherProjectsToolStripMenuItem.Name = "otherProjectsToolStripMenuItem";
labelDomainSort.Text = "Sort:"; otherProjectsToolStripMenuItem.Size = new Size(194, 22);
otherProjectsToolStripMenuItem.Text = "Other Projects";
otherProjectsToolStripMenuItem.Click += otherProjectsToolStripMenuItem_Click;
// //
// MainForm // MainForm
// //
@ -1234,5 +1248,7 @@ namespace FireWallet
private Label labelSendingHIPAddress; private Label labelSendingHIPAddress;
private ComboBox comboBoxDomainSort; private ComboBox comboBoxDomainSort;
private Label labelDomainSort; private Label labelDomainSort;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem otherProjectsToolStripMenuItem;
} }
} }

View File

@ -53,10 +53,13 @@ namespace FireWallet
LoadSettings(); LoadSettings();
UpdateTheme(); UpdateTheme();
// Theme drop down // Theme drop down
foreach (ToolStripMenuItem c in toolStripDropDownButtonHelp.DropDownItems) foreach (ToolStripItem item in toolStripDropDownButtonHelp.DropDownItems)
{ {
c.ForeColor = ColorTranslator.FromHtml(theme["foreground"]); if (item is ToolStripDropDownItem dropDownItem)
c.BackColor = ColorTranslator.FromHtml(theme["background"]); {
dropDownItem.ForeColor = ColorTranslator.FromHtml(theme["foreground"]);
dropDownItem.BackColor = ColorTranslator.FromHtml(theme["background"]);
}
} }
toolStripDropDownButtonHelp.DropDown.BackColor = ColorTranslator.FromHtml(theme["background"]); toolStripDropDownButtonHelp.DropDown.BackColor = ColorTranslator.FromHtml(theme["background"]);
@ -221,7 +224,8 @@ namespace FireWallet
return false; return false;
} }
} }
} else }
else
{ {
if (!Directory.Exists(dir + "hsd")) if (!Directory.Exists(dir + "hsd"))
{ {
@ -1650,7 +1654,7 @@ namespace FireWallet
if (!outputInstalled.Contains("git version")) if (!outputInstalled.Contains("git version"))
{ {
AddLog("Git is not installed"); AddLog("Git is not installed");
NotifyForm notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies","Install", "https://git-scm.com/download/win"); NotifyForm notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies", "Install", "https://git-scm.com/download/win");
notifyForm.ShowDialog(); notifyForm.ShowDialog();
notifyForm.Dispose(); notifyForm.Dispose();
this.Close(); this.Close();
@ -1672,7 +1676,7 @@ namespace FireWallet
if (!outputInstalled.Contains("v")) if (!outputInstalled.Contains("v"))
{ {
AddLog("Node is not installed"); AddLog("Node is not installed");
NotifyForm notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies","Install", "https://nodejs.org/en/download"); NotifyForm notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies", "Install", "https://nodejs.org/en/download");
notifyForm.ShowDialog(); notifyForm.ShowDialog();
notifyForm.Dispose(); notifyForm.Dispose();
this.Close(); this.Close();
@ -1698,7 +1702,7 @@ namespace FireWallet
{ {
AddLog("NPM is not installed"); AddLog("NPM is not installed");
AddLog(outputInstalled); AddLog(outputInstalled);
NotifyForm notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies","Install", "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm"); NotifyForm notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies", "Install", "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm");
notifyForm.ShowDialog(); notifyForm.ShowDialog();
notifyForm.Dispose(); notifyForm.Dispose();
this.Close(); this.Close();
@ -2247,6 +2251,15 @@ namespace FireWallet
}; };
Process.Start(psi); Process.Start(psi);
} }
private void otherProjectsToolStripMenuItem_Click(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = "https://nathan.woodburn.au/projects",
UseShellExecute = true
};
Process.Start(psi);
}
#endregion #endregion
} }
} }