From fcd9b195f6d00146d7e21d3d221791f3442bfcf1 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Wed, 18 Oct 2023 00:51:02 +0100 Subject: [PATCH] Minor layout tweaks (margins, padding, alignment). Signed-off-by: Konstantina Chremmou --- .../Controls/ComboBoxes/ISODropDownBox.cs | 2 + .../Controls/MultipleDvdIsoList.Designer.cs | 33 +-- XenAdmin/Controls/MultipleDvdIsoList.cs | 15 +- XenAdmin/Controls/MultipleDvdIsoList.resx | 218 +++++++----------- 4 files changed, 98 insertions(+), 170 deletions(-) diff --git a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs index d7d1f202b5..45e85dc16e 100644 --- a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs +++ b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs @@ -232,6 +232,8 @@ private void AddSR(ToStringWrapper srWrapper) } } + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public IXenConnection connection { set diff --git a/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs b/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs index 8c0f39680c..048d614f53 100644 --- a/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs +++ b/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs @@ -36,11 +36,9 @@ private void InitializeComponent() this.newCDLabel = new System.Windows.Forms.Label(); this.comboBoxDrive = new System.Windows.Forms.ComboBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.panel1 = new System.Windows.Forms.Panel(); this.cdChanger1 = new XenAdmin.Controls.CDChanger(); - this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.linkLabelEject = new System.Windows.Forms.LinkLabel(); this.tableLayoutPanel1.SuspendLayout(); - this.panel1.SuspendLayout(); this.SuspendLayout(); // // labelSingleDvd @@ -51,6 +49,7 @@ private void InitializeComponent() // newCDLabel // resources.ApplyResources(this.newCDLabel, "newCDLabel"); + this.tableLayoutPanel1.SetColumnSpan(this.newCDLabel, 4); this.newCDLabel.Cursor = System.Windows.Forms.Cursors.Hand; this.newCDLabel.ForeColor = System.Drawing.SystemColors.HotTrack; this.newCDLabel.Name = "newCDLabel"; @@ -69,20 +68,13 @@ private void InitializeComponent() resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); this.tableLayoutPanel1.Controls.Add(this.labelSingleDvd, 0, 0); this.tableLayoutPanel1.Controls.Add(this.comboBoxDrive, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.newCDLabel, 2, 1); - this.tableLayoutPanel1.Controls.Add(this.panel1, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.cdChanger1, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.linkLabelEject, 3, 0); + this.tableLayoutPanel1.Controls.Add(this.newCDLabel, 0, 1); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // - // panel1 - // - resources.ApplyResources(this.panel1, "panel1"); - this.panel1.Controls.Add(this.cdChanger1); - this.panel1.Controls.Add(this.linkLabel1); - this.panel1.Name = "panel1"; - // // cdChanger1 // - this.cdChanger1.connection = null; resources.ApplyResources(this.cdChanger1, "cdChanger1"); this.cdChanger1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.cdChanger1.DropDownHeight = 500; @@ -90,12 +82,12 @@ private void InitializeComponent() this.cdChanger1.FormattingEnabled = true; this.cdChanger1.Name = "cdChanger1"; // - // linkLabel1 + // linkLabelEject // - resources.ApplyResources(this.linkLabel1, "linkLabel1"); - this.linkLabel1.Name = "linkLabel1"; - this.linkLabel1.TabStop = true; - this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + resources.ApplyResources(this.linkLabelEject, "linkLabelEject"); + this.linkLabelEject.Name = "linkLabelEject"; + this.linkLabelEject.TabStop = true; + this.linkLabelEject.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelEject_LinkClicked); // // MultipleDvdIsoList // @@ -105,8 +97,6 @@ private void InitializeComponent() this.Name = "MultipleDvdIsoList"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); this.ResumeLayout(false); } @@ -118,7 +108,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox comboBoxDrive; private System.Windows.Forms.Label newCDLabel; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.LinkLabel linkLabelEject; } } diff --git a/XenAdmin/Controls/MultipleDvdIsoList.cs b/XenAdmin/Controls/MultipleDvdIsoList.cs index b923627245..9a8f22bfc3 100644 --- a/XenAdmin/Controls/MultipleDvdIsoList.cs +++ b/XenAdmin/Controls/MultipleDvdIsoList.cs @@ -88,8 +88,8 @@ public Color LabelNewCdForeColor [Category("Appearance")] public Color LinkLabelLinkColor { - get => linkLabel1.LinkColor; - set => linkLabel1.LinkColor = value; + get => linkLabelEject.LinkColor; + set => linkLabelEject.LinkColor = value; } #endregion @@ -174,8 +174,7 @@ private void RefreshDrives() comboBoxDrive.Visible = false; cdChanger1.Visible = false; labelSingleDvd.Visible = false; - linkLabel1.Visible = false; - panel1.Visible = false; + linkLabelEject.Visible = false; newCDLabel.Visible = VM != null && !VM.is_control_domain; } @@ -187,17 +186,15 @@ private void RefreshDrives() labelSingleDvd.Visible = true; tableLayoutPanel1.ColumnStyles[0].Width = labelSingleDvd.Width; newCDLabel.Visible = false; - panel1.Visible = true; - linkLabel1.Visible = true; + linkLabelEject.Visible = true; } else { comboBoxDrive.Visible = true; cdChanger1.Visible = true; labelSingleDvd.Visible = false; - panel1.Visible = true; newCDLabel.Visible = false; - linkLabel1.Visible = true; + linkLabelEject.Visible = true; } _inRefresh = false; @@ -279,7 +276,7 @@ private void CreateDriveAction_ShowUserInstruction(string message) }); } - private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + private void linkLabelEject_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (cdChanger1.Drive != null) cdChanger1.ChangeCD(null); diff --git a/XenAdmin/Controls/MultipleDvdIsoList.resx b/XenAdmin/Controls/MultipleDvdIsoList.resx index c0590c8d7f..38965f8799 100644 --- a/XenAdmin/Controls/MultipleDvdIsoList.resx +++ b/XenAdmin/Controls/MultipleDvdIsoList.resx @@ -117,39 +117,30 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Left + True - - - Fill - NoControl - 3, 8 - - - 3, 8, 3, 5 - - - 100, 23 + 3, 7 - 61, 15 + 61, 13 - 1 + 0 DVD Dr&ive: - - TopRight - labelSingleDvd @@ -162,65 +153,23 @@ 0 + + Left, Right + True - - Fill - - - Microsoft Sans Serif, 8.25pt, style=Bold, Underline - - - NoControl - - - 173, 30 - - - 0, 2, 2, 0 - - - 942, 47 - - - 3 - - - Click here to create a DVD drive - - - MiddleLeft - - - False - - - newCDLabel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 2 + + 4 - 70, 4 - - - 3, 4, 3, 3 - - - 120, 0 + 70, 3 100, 21 - 2 + 1 False @@ -237,17 +186,8 @@ 1 - - 4 - - - True - - - GrowAndShrink - - - Fill + + Left, Right False @@ -256,93 +196,57 @@ 15 - 0, 5 + 176, 3 - 907, 21 + 456, 21 - 0 + 2 cdChanger1 - XenAdmin.Controls.CDChanger, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + XenAdmin.Controls.CDChanger, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - panel1 + tableLayoutPanel1 - 0 + 2 - - True + + Left - - Right + + True - + NoControl - - 907, 5 + + 638, 7 - - 3, 3, 3, 3 + + 31, 13 - - 3, 5, 3, 3 - - - 37, 21 - - - 1 + + 3 - + Eject - - linkLabel1 + + linkLabelEject - + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel1 - - - 1 - - - Fill - - - 173, 0 - - - 0, 0, 0, 0 - - - 0, 5, 0, 5 - - - 944, 28 - - - 40 - - - panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + tableLayoutPanel1 - + 3 @@ -355,10 +259,10 @@ 2 - 1117, 77 + 672, 77 - 40 + 0 tableLayoutPanel1 @@ -373,7 +277,43 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSingleDvd" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxDrive" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="newCDLabel" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="panel1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,Percent,100" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSingleDvd" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxDrive" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="cdChanger1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="linkLabelEject" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="newCDLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,Percent,100" /></TableLayoutSettings> + + + Microsoft Sans Serif, 8.25pt, style=Bold, Underline + + + NoControl + + + 3, 45 + + + 666, 13 + + + 4 + + + Click here to create a DVD drive + + + TopCenter + + + False + + + newCDLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 True @@ -382,7 +322,7 @@ 96, 96 - 1117, 77 + 672, 77 MultipleDvdIsoList