Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs layout alignment - FormCreateBranch #8490

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 36 additions & 30 deletions GitUI/CommandsDialogs/FormCreateBranch.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions GitUI/CommandsDialogs/FormCreateBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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;
Expand Down Expand Up @@ -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<Label>())
Expand Down