diff --git a/GitUI/CommandsDialogs/FormCreateBranch.Designer.cs b/GitUI/CommandsDialogs/FormCreateBranch.Designer.cs index 72a5510a158..db0f7f3ab68 100644 --- a/GitUI/CommandsDialogs/FormCreateBranch.Designer.cs +++ b/GitUI/CommandsDialogs/FormCreateBranch.Designer.cs @@ -42,11 +42,18 @@ private void InitializeComponent() this.groupBox1 = new System.Windows.Forms.GroupBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.gotoUserManualControl1 = new GitUI.UserControls.GotoUserManualControl(); + this.MainPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // + // MainPanel + // + this.MainPanel.Controls.Add(this.Ok); + this.MainPanel.Controls.Add(this.tableLayoutPanel1); + this.MainPanel.Size = new System.Drawing.Size(480, 203); + // // label2 // this.label2.AutoSize = true; @@ -54,19 +61,20 @@ private void InitializeComponent() this.label2.Location = new System.Drawing.Point(3, 31); this.label2.Margin = new System.Windows.Forms.Padding(3); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(149, 22); + this.label2.Size = new System.Drawing.Size(144, 22); this.label2.TabIndex = 2; this.label2.Text = "Create b&ranch at this revision"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // commitPickerSmallControl1 // + this.commitPickerSmallControl1.AutoSize = true; this.commitPickerSmallControl1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.commitPickerSmallControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.commitPickerSmallControl1.Location = new System.Drawing.Point(158, 31); + this.commitPickerSmallControl1.Location = new System.Drawing.Point(153, 31); this.commitPickerSmallControl1.MinimumSize = new System.Drawing.Size(100, 26); this.commitPickerSmallControl1.Name = "commitPickerSmallControl1"; - this.commitPickerSmallControl1.Size = new System.Drawing.Size(287, 26); + this.commitPickerSmallControl1.Size = new System.Drawing.Size(306, 26); this.commitPickerSmallControl1.TabIndex = 3; // // chkbxCheckoutAfterCreate @@ -75,9 +83,9 @@ private void InitializeComponent() this.chkbxCheckoutAfterCreate.Checked = true; this.chkbxCheckoutAfterCreate.CheckState = System.Windows.Forms.CheckState.Checked; this.chkbxCheckoutAfterCreate.Dock = System.Windows.Forms.DockStyle.Fill; - this.chkbxCheckoutAfterCreate.Location = new System.Drawing.Point(158, 59); + this.chkbxCheckoutAfterCreate.Location = new System.Drawing.Point(153, 59); this.chkbxCheckoutAfterCreate.Name = "chkbxCheckoutAfterCreate"; - this.chkbxCheckoutAfterCreate.Size = new System.Drawing.Size(287, 22); + this.chkbxCheckoutAfterCreate.Size = new System.Drawing.Size(306, 22); this.chkbxCheckoutAfterCreate.TabIndex = 5; this.chkbxCheckoutAfterCreate.Text = "Checkout &after create"; this.chkbxCheckoutAfterCreate.UseVisualStyleBackColor = true; @@ -89,7 +97,7 @@ private void InitializeComponent() this.label1.Location = new System.Drawing.Point(3, 3); this.label1.Margin = new System.Windows.Forms.Padding(3); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(149, 22); + this.label1.Size = new System.Drawing.Size(144, 22); this.label1.TabIndex = 0; this.label1.Text = "&Branch name"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -97,9 +105,9 @@ private void InitializeComponent() // BranchNameTextBox // this.BranchNameTextBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.BranchNameTextBox.Location = new System.Drawing.Point(158, 3); + this.BranchNameTextBox.Location = new System.Drawing.Point(153, 3); this.BranchNameTextBox.Name = "BranchNameTextBox"; - this.BranchNameTextBox.Size = new System.Drawing.Size(287, 21); + this.BranchNameTextBox.Size = new System.Drawing.Size(306, 20); this.BranchNameTextBox.TabIndex = 1; this.BranchNameTextBox.Leave += new System.EventHandler(this.BranchNameTextBox_Leave); // @@ -108,7 +116,7 @@ private void InitializeComponent() this.Orphan.AutoSize = true; this.Orphan.Location = new System.Drawing.Point(11, 3); this.Orphan.Name = "Orphan"; - this.Orphan.Size = new System.Drawing.Size(96, 17); + this.Orphan.Size = new System.Drawing.Size(93, 17); this.Orphan.TabIndex = 1; this.Orphan.Text = "Create or&phan"; this.toolTip.SetToolTip(this.Orphan, "New branch will have NO parents"); @@ -121,9 +129,9 @@ private void InitializeComponent() this.ClearOrphan.Checked = true; this.ClearOrphan.CheckState = System.Windows.Forms.CheckState.Checked; this.ClearOrphan.Enabled = false; - this.ClearOrphan.Location = new System.Drawing.Point(113, 3); + this.ClearOrphan.Location = new System.Drawing.Point(110, 3); this.ClearOrphan.Name = "ClearOrphan"; - this.ClearOrphan.Size = new System.Drawing.Size(187, 17); + this.ClearOrphan.Size = new System.Drawing.Size(182, 17); this.ClearOrphan.TabIndex = 3; this.ClearOrphan.Text = "Clear &working directory and index"; this.toolTip.SetToolTip(this.ClearOrphan, "Remove files from the working directory and from the index"); @@ -133,20 +141,20 @@ private void InitializeComponent() // this.Ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.Ok.DialogResult = System.Windows.Forms.DialogResult.OK; - this.Ok.Image = global::GitUI.Properties.Images.BranchCreate; - this.Ok.Location = new System.Drawing.Point(317, 146); - this.Ok.MinimumSize = new System.Drawing.Size(0, 30); + this.Ok.ImageAlign = System.Drawing.ContentAlignment.TopLeft; + this.Ok.Location = new System.Drawing.Point(-2, 3); + this.Ok.MinimumSize = new System.Drawing.Size(75, 23); this.Ok.Name = "Ok"; - this.Ok.Size = new System.Drawing.Size(128, 30); + this.Ok.Size = new System.Drawing.Size(75, 23); this.Ok.TabIndex = 7; this.Ok.Text = "&Create branch"; - this.Ok.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.Ok.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.Ok.UseVisualStyleBackColor = true; this.Ok.Click += new System.EventHandler(this.OkClick); // // tableLayoutPanel1 // + this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.AutoSize = true; this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tableLayoutPanel1.ColumnCount = 2; @@ -158,10 +166,9 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); this.tableLayoutPanel1.Controls.Add(this.chkbxCheckoutAfterCreate, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.Ok, 1, 4); this.tableLayoutPanel1.Controls.Add(this.gotoUserManualControl1, 0, 4); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; - this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 8); + this.tableLayoutPanel1.Location = new System.Drawing.Point(9, 9); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 5; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F)); @@ -169,7 +176,7 @@ private void InitializeComponent() this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(448, 179); + this.tableLayoutPanel1.Size = new System.Drawing.Size(462, 173); this.tableLayoutPanel1.TabIndex = 0; // // groupBox1 @@ -182,7 +189,7 @@ private void InitializeComponent() this.groupBox1.Location = new System.Drawing.Point(3, 87); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(8); - this.groupBox1.Size = new System.Drawing.Size(442, 53); + this.groupBox1.Size = new System.Drawing.Size(456, 52); this.groupBox1.TabIndex = 6; this.groupBox1.TabStop = false; this.groupBox1.Text = "Orphan"; @@ -194,17 +201,17 @@ private void InitializeComponent() this.flowLayoutPanel1.Controls.Add(this.Orphan); this.flowLayoutPanel1.Controls.Add(this.ClearOrphan); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel1.Location = new System.Drawing.Point(8, 22); + this.flowLayoutPanel1.Location = new System.Drawing.Point(8, 21); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(8, 0, 0, 0); - this.flowLayoutPanel1.Size = new System.Drawing.Size(426, 23); + this.flowLayoutPanel1.Size = new System.Drawing.Size(440, 23); this.flowLayoutPanel1.TabIndex = 1; // // gotoUserManualControl1 // this.gotoUserManualControl1.AutoSize = true; this.gotoUserManualControl1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.gotoUserManualControl1.Location = new System.Drawing.Point(3, 151); + this.gotoUserManualControl1.Location = new System.Drawing.Point(3, 150); this.gotoUserManualControl1.ManualSectionAnchorName = "create-branch"; this.gotoUserManualControl1.ManualSectionSubfolder = "branches"; this.gotoUserManualControl1.Margin = new System.Windows.Forms.Padding(3, 8, 3, 3); @@ -218,17 +225,16 @@ private void InitializeComponent() this.AcceptButton = this.Ok; this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(464, 196); - this.Controls.Add(this.tableLayoutPanel1); + this.ClientSize = new System.Drawing.Size(480, 235); this.DoubleBuffered = true; this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(480, 235); + this.MinimumSize = new System.Drawing.Size(480, 250); this.Name = "FormCreateBranch"; - this.Padding = new System.Windows.Forms.Padding(8); this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Create branch"; - this.Shown += new System.EventHandler(this.FormCreateBranch_Shown); + this.MainPanel.ResumeLayout(false); + this.MainPanel.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.groupBox1.ResumeLayout(false); diff --git a/GitUI/CommandsDialogs/FormCreateBranch.cs b/GitUI/CommandsDialogs/FormCreateBranch.cs index 3bf0b16d1ae..a22d130a001 100644 --- a/GitUI/CommandsDialogs/FormCreateBranch.cs +++ b/GitUI/CommandsDialogs/FormCreateBranch.cs @@ -11,7 +11,7 @@ namespace GitUI.CommandsDialogs { - public sealed partial class FormCreateBranch : GitModuleForm + public sealed partial class FormCreateBranch : GitExtensionsDialog { private readonly TranslationString _noRevisionSelected = new TranslationString("Select 1 revision to create the branch on."); private readonly TranslationString _branchNameIsEmpty = new TranslationString("Enter branch name."); @@ -30,9 +30,14 @@ private FormCreateBranch() } public FormCreateBranch(GitUICommands commands, ObjectId objectId, string newBranchNamePrefix = null) - : base(commands) + : base(commands, enablePositionRestore: false) { InitializeComponent(); + + // work-around the designer bug that can't add controls to FlowLayoutPanel + ControlsPanel.Controls.Add(Ok); + AcceptButton = Ok; + InitializeComplete(); groupBox1.AutoSize = true; @@ -74,8 +79,10 @@ private void BranchNameTextBox_Leave(object sender, EventArgs e) BranchNameTextBox.SelectionStart = caretPosition; } - private void FormCreateBranch_Shown(object sender, EventArgs e) + protected override void OnShown(EventArgs e) { + base.OnShown(e); + // ensure all labels are wrapped if required // this must happen only after the label texts have been set foreach (var label in this.FindDescendantsOfType