From ab77f9de210d2dfd019c16d169d432a217003c06 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Fri, 23 May 2025 17:13:32 +0300 Subject: [PATCH] Little UI fixes --- McBitFont/Form1.Designer.cs | 52 +++++++++++++++++++++++-------------- McBitFont/Form1.cs | 14 ++++++---- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/McBitFont/Form1.Designer.cs b/McBitFont/Form1.Designer.cs index 180d8a9..1c3f87e 100644 --- a/McBitFont/Form1.Designer.cs +++ b/McBitFont/Form1.Designer.cs @@ -56,13 +56,14 @@ btnApply = new System.Windows.Forms.Button(); hScroll = new System.Windows.Forms.HScrollBar(); vScroll = new System.Windows.Forms.VScrollBar(); - label5 = new System.Windows.Forms.Label(); + lblCoords = new System.Windows.Forms.Label(); menuStrip1 = new System.Windows.Forms.MenuStrip(); fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -95,7 +96,7 @@ toolTip1 = new System.Windows.Forms.ToolTip(components); chkLeftSide = new System.Windows.Forms.CheckBox(); chkTopSide = new System.Windows.Forms.CheckBox(); - importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + label3 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)nudX).BeginInit(); ((System.ComponentModel.ISupportInitialize)nudY).BeginInit(); panel1.SuspendLayout(); @@ -472,17 +473,17 @@ vScroll.TabIndex = 15; vScroll.ValueChanged += scroll_ValueChanged; // - // label5 + // lblCoords // - label5.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; - label5.AutoSize = true; - label5.Location = new System.Drawing.Point(646, 132); - label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - label5.Name = "label5"; - label5.Size = new System.Drawing.Size(24, 15); - label5.TabIndex = 16; - label5.Text = "X,Y"; - label5.TextAlign = System.Drawing.ContentAlignment.TopRight; + lblCoords.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right; + lblCoords.AutoSize = true; + lblCoords.Location = new System.Drawing.Point(643, 132); + lblCoords.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + lblCoords.Name = "lblCoords"; + lblCoords.Size = new System.Drawing.Size(24, 15); + lblCoords.TabIndex = 16; + lblCoords.Text = "X,Y"; + lblCoords.TextAlign = System.Drawing.ContentAlignment.TopRight; // // menuStrip1 // @@ -545,6 +546,14 @@ saveAsToolStripMenuItem.ToolTipText = "Save changes to another file"; saveAsToolStripMenuItem.Click += SaveToolStripMenuItem_Click; // + // importImageToolStripMenuItem + // + importImageToolStripMenuItem.Image = Properties.Resources.z_folder_image; + importImageToolStripMenuItem.Name = "importImageToolStripMenuItem"; + importImageToolStripMenuItem.Size = new System.Drawing.Size(184, 22); + importImageToolStripMenuItem.Text = "Import image"; + importImageToolStripMenuItem.Click += importImageToolStripMenuItem_Click; + // // exportToolStripMenuItem // exportToolStripMenuItem.Image = Properties.Resources.z_export; @@ -865,25 +874,27 @@ toolTip1.SetToolTip(chkTopSide, "Height changes will be made on Top/Bottom side"); chkTopSide.UseVisualStyleBackColor = true; // - // importImageToolStripMenuItem + // label3 // - importImageToolStripMenuItem.Image = Properties.Resources.z_folder_image; - importImageToolStripMenuItem.Name = "importImageToolStripMenuItem"; - importImageToolStripMenuItem.Size = new System.Drawing.Size(184, 22); - importImageToolStripMenuItem.Text = "Import image"; - importImageToolStripMenuItem.Click += importImageToolStripMenuItem_Click; + label3.AutoSize = true; + label3.Location = new System.Drawing.Point(642, 117); + label3.Name = "label3"; + label3.Size = new System.Drawing.Size(45, 15); + label3.TabIndex = 21; + label3.Text = "Cursor:"; // // MainForm // AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; ClientSize = new System.Drawing.Size(915, 647); + Controls.Add(label3); Controls.Add(chkTopSide); Controls.Add(chkLeftSide); Controls.Add(btnBaseline); Controls.Add(btnApply); Controls.Add(btnExport); - Controls.Add(label5); + Controls.Add(lblCoords); Controls.Add(vScroll); Controls.Add(hScroll); Controls.Add(miniList); @@ -941,7 +952,7 @@ private System.Windows.Forms.Button btnApply; private System.Windows.Forms.HScrollBar hScroll; private System.Windows.Forms.VScrollBar vScroll; - private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label lblCoords; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; @@ -990,6 +1001,7 @@ private System.Windows.Forms.ToolStripMenuItem tsmiCodeShift; private System.Windows.Forms.ToolStripMenuItem tsmiMakeVarWidth; private System.Windows.Forms.ToolStripMenuItem importImageToolStripMenuItem; + private System.Windows.Forms.Label label3; } } diff --git a/McBitFont/Form1.cs b/McBitFont/Form1.cs index e083773..2a0bf8d 100644 --- a/McBitFont/Form1.cs +++ b/McBitFont/Form1.cs @@ -95,7 +95,7 @@ namespace McBitFont { ListViewItem_SetSpacing(miniList, 50 + 2, 50 + 22); - this.Text = "McBitFont " + version + " - " + prjName; + SetWindowCap(); fbuf = new FrameMiniature(0, dotWidth, dotHeight); @@ -330,7 +330,7 @@ namespace McBitFont { // Change coordinates in the panel int i = (e.X - pixelOffset + hScroll.Value) / (cellSize + gap); int j = (e.Y - pixelOffset + vScroll.Value) / (cellSize + gap); - label5.Text = i.ToString() + ',' + j.ToString(); + lblCoords.Text = i.ToString() + ',' + j.ToString(); // history management if (e.Button != MouseButtons.None && !mouseDown) { @@ -660,7 +660,7 @@ namespace McBitFont { prjName = "Untitled"; prjFileName = ""; - this.Text = "McBitFont " + version + " - " + prjName; + SetWindowCap(); modified = false; CheckForAdd(); fbuffer = false; @@ -775,7 +775,7 @@ namespace McBitFont { prjFileName = filename; prjName = Path.GetFileNameWithoutExtension(filename); - this.Text = "McBitFont " + version + " - " + prjName; + SetWindowCap(); miniList.Items[0].Selected = true; @@ -805,7 +805,11 @@ namespace McBitFont { prjModified = false; prjName = Path.GetFileNameWithoutExtension(filename); prjFileName = filename; - this.Text = "McBitFont " + version + " - " + prjName; + SetWindowCap(); + } + + private void SetWindowCap() { + this.Text = "McBitFont v" + version + " - " + prjName; } private void openToolStripMenuItem_Click(object sender, EventArgs e) {