diff --git a/UnityLauncher/Form1.Designer.cs b/UnityLauncher/Form1.Designer.cs index 273be79..8dbcd32 100644 --- a/UnityLauncher/Form1.Designer.cs +++ b/UnityLauncher/Form1.Designer.cs @@ -75,6 +75,7 @@ private void InitializeComponent() this.btnAddPackFolder = new System.Windows.Forms.Button(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.tbSearchBar = new System.Windows.Forms.TextBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridRecent)).BeginInit(); @@ -82,7 +83,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.gridUnityList)).BeginInit(); this.tabPackages.SuspendLayout(); this.tabPage3.SuspendLayout(); - this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -99,6 +99,7 @@ private void InitializeComponent() // // tabPage1 // + this.tabPage1.Controls.Add(this.tbSearchBar); this.tabPage1.Controls.Add(this.btnUpgradeProject); this.tabPage1.Controls.Add(this.btnRunUnityOnly); this.tabPage1.Controls.Add(this.btnOpenUnityFolder); @@ -170,7 +171,7 @@ private void InitializeComponent() this._path, this._dateModified}); this.gridRecent.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.gridRecent.Location = new System.Drawing.Point(3, 3); + this.gridRecent.Location = new System.Drawing.Point(3, 30); this.gridRecent.MultiSelect = false; this.gridRecent.Name = "gridRecent"; this.gridRecent.ReadOnly = true; @@ -179,7 +180,7 @@ private void InitializeComponent() this.gridRecent.ShowCellErrors = false; this.gridRecent.ShowCellToolTips = false; this.gridRecent.ShowEditingIcon = false; - this.gridRecent.Size = new System.Drawing.Size(574, 502); + this.gridRecent.Size = new System.Drawing.Size(574, 475); this.gridRecent.TabIndex = 0; this.gridRecent.KeyDown += new System.Windows.Forms.KeyEventHandler(this.gridRecent_KeyDown); // @@ -565,6 +566,14 @@ private void InitializeComponent() this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17); this.toolStripStatusLabel1.Text = "toolStripStatusLabel1"; // + // tbSearchBar + // + this.tbSearchBar.Location = new System.Drawing.Point(9, 4); + this.tbSearchBar.Name = "tbSearchBar"; + this.tbSearchBar.Size = new System.Drawing.Size(563, 20); + this.tbSearchBar.TabIndex = 17; + this.tbSearchBar.TextChanged += new System.EventHandler(this.FilterRecentProject); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -584,6 +593,7 @@ private void InitializeComponent() this.Resize += new System.EventHandler(this.Form1_Resize); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridRecent)).EndInit(); this.tabPage2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridUnityList)).EndInit(); @@ -591,8 +601,6 @@ private void InitializeComponent() this.tabPackages.PerformLayout(); this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -644,6 +652,7 @@ private void InitializeComponent() private System.Windows.Forms.DataGridViewTextBoxColumn _path; private System.Windows.Forms.DataGridViewTextBoxColumn _dateModified; private System.Windows.Forms.Button btnOpenLogFolder; + private System.Windows.Forms.TextBox tbSearchBar; } } diff --git a/UnityLauncher/Form1.cs b/UnityLauncher/Form1.cs index 0174267..ed227bd 100644 --- a/UnityLauncher/Form1.cs +++ b/UnityLauncher/Form1.cs @@ -228,6 +228,16 @@ private string GetUnityVersion(string path) return fvi.ProductName.Replace("(64-bit)", "").Trim(); } + void FilterRecentProject(object sender, EventArgs e) + { + SetStatus("Filtering recent projects list.."); + foreach (DataGridViewRow recentProject in gridRecent.Rows) + { + if (recentProject.Cells["_project"].Value.ToString().ToLower().Contains(tbSearchBar.Text.ToLower())) + recentProject.Visible = true; + else recentProject.Visible = false; + } + } // returns already sorted list of recent entries void UpdateRecentProjectsList() @@ -691,6 +701,12 @@ private void Form1_KeyPress(object sender, KeyPressEventArgs e) tabControl1.SelectedIndex = 3; break; default: + if (!tbSearchBar.Focused) + { + tbSearchBar.Focus(); + tbSearchBar.Text += e.KeyChar; + tbSearchBar.Select(tbSearchBar.Text.Length,0); + } break; } }