From b037e8c0bdfebf85e9bcef3c0ed17162a1eeb216 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 31 Jul 2021 17:09:43 +0100 Subject: [PATCH] Changed: minimum 1 row per group + extra menu item entry --- Windows/Forms/TilePanelLayout.Designer.cs | 35 ++++++++++--- Windows/Forms/TilePanelLayout.cs | 20 ++++++-- Windows/Forms/TilePanelLayout.resx | 62 +---------------------- 3 files changed, 45 insertions(+), 72 deletions(-) diff --git a/Windows/Forms/TilePanelLayout.Designer.cs b/Windows/Forms/TilePanelLayout.Designer.cs index 9da7f33..db0008e 100644 --- a/Windows/Forms/TilePanelLayout.Designer.cs +++ b/Windows/Forms/TilePanelLayout.Designer.cs @@ -46,6 +46,8 @@ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); this.label1 = new System.Windows.Forms.Label(); + this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); + this.removeRowToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); this.SuspendLayout(); @@ -54,9 +56,11 @@ // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addToolStripMenuItem, - this.addListToolStripMenuItem}); + this.addListToolStripMenuItem, + this.toolStripMenuItem6, + this.removeRowToolStripMenuItem1}); this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70); + this.contextMenuStrip1.Size = new System.Drawing.Size(181, 98); // // addToolStripMenuItem // @@ -176,23 +180,36 @@ this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(99)))), ((int)(((byte)(105)))), ((int)(((byte)(119))))); this.label1.Image = global::FizzyLauncher.AppResource.toggle_left_ea_16; this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.label1.Location = new System.Drawing.Point(227, 72); + this.label1.Location = new System.Drawing.Point(265, 83); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(0, 13); + this.label1.Size = new System.Drawing.Size(0, 15); this.label1.TabIndex = 2; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick); this.label1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.label1_MouseClick); // - // TTilePanelLayout + // toolStripMenuItem6 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.toolStripMenuItem6.Name = "toolStripMenuItem6"; + this.toolStripMenuItem6.Size = new System.Drawing.Size(177, 6); + // + // removeRowToolStripMenuItem1 + // + this.removeRowToolStripMenuItem1.Name = "removeRowToolStripMenuItem1"; + this.removeRowToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); + this.removeRowToolStripMenuItem1.Text = "&Remove Row"; + this.removeRowToolStripMenuItem1.Click += new System.EventHandler(this.removeRowToolStripMenuItem1_Click); + // + // TilePanelLayout + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.label1); - this.Name = "TTilePanelLayout"; - this.Size = new System.Drawing.Size(370, 150); + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.Name = "TilePanelLayout"; + this.Size = new System.Drawing.Size(432, 173); this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip2.ResumeLayout(false); this.ResumeLayout(false); @@ -218,5 +235,7 @@ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem removeRowToolStripMenuItem; private System.Windows.Forms.Label label1; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6; + private System.Windows.Forms.ToolStripMenuItem removeRowToolStripMenuItem1; } } diff --git a/Windows/Forms/TilePanelLayout.cs b/Windows/Forms/TilePanelLayout.cs index a975ba2..66cf586 100644 --- a/Windows/Forms/TilePanelLayout.cs +++ b/Windows/Forms/TilePanelLayout.cs @@ -796,11 +796,18 @@ namespace FizzyLauncher.Windows.Forms private void removeRowToolStripMenuItem_Click(object sender, EventArgs e) { - bool rs = items.Exists(x => x.Coord.Y.Equals(gridSize.Y - 1)); - if (!rs) + if (gridSize.Y <= 1) { - this.SetGridSize(gridSize.X, (gridSize.Y - 1)); + return; } + + bool rs = items.Exists(x => x.Coord.Y.Equals(gridSize.Y - 1)); + if (rs) + { + return; + } + + this.SetGridSize(gridSize.X, (gridSize.Y - 1)); } private async void label1_MouseClick(object sender, MouseEventArgs e) @@ -845,5 +852,12 @@ namespace FizzyLauncher.Windows.Forms } } + /// + /// Remove row + /// + /// + /// + private void removeRowToolStripMenuItem1_Click(object sender, EventArgs e) => removeRowToolStripMenuItem_Click(sender, e); + } } diff --git a/Windows/Forms/TilePanelLayout.resx b/Windows/Forms/TilePanelLayout.resx index 8baf68f..b5d6123 100644 --- a/Windows/Forms/TilePanelLayout.resx +++ b/Windows/Forms/TilePanelLayout.resx @@ -1,64 +1,4 @@ - - - +