From d55b1d87feba85fe75ac7bad7487aeef5b4034a4 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 1 Oct 2022 12:57:24 -0700 Subject: [PATCH] Minor tweaks Main window's Button size 35->40 Add icon as resource Remove useless border around main window folder path --- pkNX.WinForms/Main.Designer.cs | 60 +++++++++--------- pkNX.WinForms/Main.cs | 8 +-- pkNX.WinForms/Main.resx | 62 +------------------ pkNX.WinForms/ProgramSettings.cs | 7 +++ .../Properties/Resources.Designer.cs | 10 +++ pkNX.WinForms/Properties/Resources.resx | 3 + pkNX.WinForms/pkNX.WinForms.csproj | 3 + 7 files changed, 54 insertions(+), 99 deletions(-) create mode 100644 pkNX.WinForms/ProgramSettings.cs diff --git a/pkNX.WinForms/Main.Designer.cs b/pkNX.WinForms/Main.Designer.cs index bf578632..3d9d8c1a 100644 --- a/pkNX.WinForms/Main.Designer.cs +++ b/pkNX.WinForms/Main.Designer.cs @@ -1,4 +1,4 @@ -namespace pkNX.WinForms +namespace pkNX.WinForms { partial class Main { @@ -34,6 +34,7 @@ private void InitializeComponent() this.Menu_File = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Open = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Exit = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Save = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Options = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Language = new System.Windows.Forms.ToolStripMenuItem(); this.CB_Lang = new System.Windows.Forms.ToolStripComboBox(); @@ -42,7 +43,6 @@ private void InitializeComponent() this.Menu_Restore = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Current = new System.Windows.Forms.ToolStripMenuItem(); this.FLP_Controls = new System.Windows.Forms.FlowLayoutPanel(); - this.Menu_Save = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -50,25 +50,25 @@ private void InitializeComponent() // this.TB_Path.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.TB_Path.Location = new System.Drawing.Point(186, 6); - this.TB_Path.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.TB_Path.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.TB_Path.Location = new System.Drawing.Point(124, 5); this.TB_Path.Name = "TB_Path"; this.TB_Path.ReadOnly = true; - this.TB_Path.Size = new System.Drawing.Size(414, 26); + this.TB_Path.Size = new System.Drawing.Size(288, 16); this.TB_Path.TabIndex = 10; this.TB_Path.Text = "No Game Loaded"; // // menuStrip1 // this.menuStrip1.BackColor = System.Drawing.SystemColors.Control; - this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(2, 2, 0, 2); this.menuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.Menu_File, this.Menu_Options}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(620, 35); + this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1); + this.menuStrip1.Size = new System.Drawing.Size(413, 24); this.menuStrip1.TabIndex = 12; this.menuStrip1.Text = "menuStrip1"; // @@ -79,14 +79,14 @@ private void InitializeComponent() this.Menu_Exit, this.Menu_Save}); this.Menu_File.Name = "Menu_File"; - this.Menu_File.Size = new System.Drawing.Size(54, 29); + this.Menu_File.Size = new System.Drawing.Size(37, 22); this.Menu_File.Text = "File"; // // Menu_Open // this.Menu_Open.Name = "Menu_Open"; this.Menu_Open.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.Menu_Open.Size = new System.Drawing.Size(270, 34); + this.Menu_Open.Size = new System.Drawing.Size(155, 22); this.Menu_Open.Text = "&Open..."; this.Menu_Open.Click += new System.EventHandler(this.Menu_Open_Click); // @@ -94,10 +94,18 @@ private void InitializeComponent() // this.Menu_Exit.Name = "Menu_Exit"; this.Menu_Exit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q))); - this.Menu_Exit.Size = new System.Drawing.Size(270, 34); + this.Menu_Exit.Size = new System.Drawing.Size(155, 22); this.Menu_Exit.Text = "&Exit"; this.Menu_Exit.Click += new System.EventHandler(this.Menu_Exit_Click); // + // Menu_Save + // + this.Menu_Save.Name = "Menu_Save"; + this.Menu_Save.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.Menu_Save.Size = new System.Drawing.Size(155, 22); + this.Menu_Save.Text = "&Save"; + this.Menu_Save.Click += new System.EventHandler(this.Menu_Save_Click); + // // Menu_Options // this.Menu_Options.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -106,7 +114,7 @@ private void InitializeComponent() this.Menu_Restore, this.Menu_Current}); this.Menu_Options.Name = "Menu_Options"; - this.Menu_Options.Size = new System.Drawing.Size(92, 29); + this.Menu_Options.Size = new System.Drawing.Size(61, 22); this.Menu_Options.Text = "Options"; // // Menu_Language @@ -114,7 +122,7 @@ private void InitializeComponent() this.Menu_Language.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.CB_Lang}); this.Menu_Language.Name = "Menu_Language"; - this.Menu_Language.Size = new System.Drawing.Size(336, 34); + this.Menu_Language.Size = new System.Drawing.Size(222, 22); this.Menu_Language.Text = "Language"; // // CB_Lang @@ -132,7 +140,7 @@ private void InitializeComponent() "汉字简化方案", "漢字簡化方案"}); this.CB_Lang.Name = "CB_Lang"; - this.CB_Lang.Size = new System.Drawing.Size(121, 33); + this.CB_Lang.Size = new System.Drawing.Size(121, 23); this.CB_Lang.SelectedIndexChanged += new System.EventHandler(this.ChangeLanguage); // // randomizationToolStripMenuItem @@ -140,13 +148,13 @@ private void InitializeComponent() this.randomizationToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.Menu_SetRNGSeed}); this.randomizationToolStripMenuItem.Name = "randomizationToolStripMenuItem"; - this.randomizationToolStripMenuItem.Size = new System.Drawing.Size(336, 34); + this.randomizationToolStripMenuItem.Size = new System.Drawing.Size(222, 22); this.randomizationToolStripMenuItem.Text = "Randomization"; // // Menu_SetRNGSeed // this.Menu_SetRNGSeed.Name = "Menu_SetRNGSeed"; - this.Menu_SetRNGSeed.Size = new System.Drawing.Size(226, 34); + this.Menu_SetRNGSeed.Size = new System.Drawing.Size(146, 22); this.Menu_SetRNGSeed.Text = "Set int32 seed"; this.Menu_SetRNGSeed.Click += new System.EventHandler(this.Menu_SetRNGSeed_Click); // @@ -154,7 +162,7 @@ private void InitializeComponent() // this.Menu_Restore.Enabled = false; this.Menu_Restore.Name = "Menu_Restore"; - this.Menu_Restore.Size = new System.Drawing.Size(336, 34); + this.Menu_Restore.Size = new System.Drawing.Size(222, 22); this.Menu_Restore.Text = "Restore Original Files"; // // Menu_Current @@ -162,7 +170,7 @@ private void InitializeComponent() this.Menu_Current.Enabled = false; this.Menu_Current.Name = "Menu_Current"; this.Menu_Current.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.Menu_Current.Size = new System.Drawing.Size(336, 34); + this.Menu_Current.Size = new System.Drawing.Size(222, 22); this.Menu_Current.Text = "Open Current Folder"; this.Menu_Current.Click += new System.EventHandler(this.Menu_Current_Click); // @@ -170,32 +178,22 @@ private void InitializeComponent() // this.FLP_Controls.AutoScroll = true; this.FLP_Controls.Dock = System.Windows.Forms.DockStyle.Fill; - this.FLP_Controls.Location = new System.Drawing.Point(0, 35); - this.FLP_Controls.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.FLP_Controls.Location = new System.Drawing.Point(0, 24); this.FLP_Controls.Name = "FLP_Controls"; - this.FLP_Controls.Size = new System.Drawing.Size(620, 414); + this.FLP_Controls.Size = new System.Drawing.Size(413, 275); this.FLP_Controls.TabIndex = 13; // - // Menu_Save - // - this.Menu_Save.Name = "Menu_Save"; - this.Menu_Save.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.Menu_Save.Size = new System.Drawing.Size(270, 34); - this.Menu_Save.Text = "&Save"; - this.Menu_Save.Click += new System.EventHandler(this.Menu_Save_Click); - // // Main // this.AllowDrop = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(620, 449); + this.ClientSize = new System.Drawing.Size(413, 299); this.Controls.Add(this.FLP_Controls); this.Controls.Add(this.TB_Path); this.Controls.Add(this.menuStrip1); this.DoubleBuffered = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "Main"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "pkNX"; diff --git a/pkNX.WinForms/Main.cs b/pkNX.WinForms/Main.cs index f240daf7..0a6d187f 100644 --- a/pkNX.WinForms/Main.cs +++ b/pkNX.WinForms/Main.cs @@ -11,12 +11,6 @@ namespace pkNX.WinForms; -public class ProgramSettings -{ - public int Language { get; set; } = 2; - public string GamePath { get; set; } = string.Empty; -} - public partial class Main : Form { public static readonly string ProgramSettingsPath = Path.Combine(Application.StartupPath, "settings.json"); @@ -176,7 +170,7 @@ private void OpenFolder(string path) private void LoadROM(EditorBase editor) { Editor = editor; - var ctrl = Editor.GetControls(120, 35).OrderBy(x => x.Text); + var ctrl = Editor.GetControls(120, 40).OrderBy(x => x.Text); FLP_Controls.Controls.Clear(); foreach (var c in ctrl) FLP_Controls.Controls.Add(c); diff --git a/pkNX.WinForms/Main.resx b/pkNX.WinForms/Main.resx index 802bb8f3..47a57710 100644 --- a/pkNX.WinForms/Main.resx +++ b/pkNX.WinForms/Main.resx @@ -1,64 +1,4 @@ - - - + diff --git a/pkNX.WinForms/ProgramSettings.cs b/pkNX.WinForms/ProgramSettings.cs new file mode 100644 index 00000000..cc1e3cba --- /dev/null +++ b/pkNX.WinForms/ProgramSettings.cs @@ -0,0 +1,7 @@ +namespace pkNX.WinForms; + +public class ProgramSettings +{ + public int Language { get; set; } = 2; + public string GamePath { get; set; } = string.Empty; +} diff --git a/pkNX.WinForms/Properties/Resources.Designer.cs b/pkNX.WinForms/Properties/Resources.Designer.cs index 9a0785e6..9f0f0de8 100644 --- a/pkNX.WinForms/Properties/Resources.Designer.cs +++ b/pkNX.WinForms/Properties/Resources.Designer.cs @@ -59,5 +59,15 @@ public class Resources { resourceCulture = value; } } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + public static System.Drawing.Icon Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } } } diff --git a/pkNX.WinForms/Properties/Resources.resx b/pkNX.WinForms/Properties/Resources.resx index 267ed3e4..357d473c 100644 --- a/pkNX.WinForms/Properties/Resources.resx +++ b/pkNX.WinForms/Properties/Resources.resx @@ -118,4 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/pkNX.WinForms/pkNX.WinForms.csproj b/pkNX.WinForms/pkNX.WinForms.csproj index 8a84f147..9058a4c6 100644 --- a/pkNX.WinForms/pkNX.WinForms.csproj +++ b/pkNX.WinForms/pkNX.WinForms.csproj @@ -31,6 +31,9 @@ True Resources.resx + + + PublicResXFileCodeGenerator Resources.Designer.cs