Skip to content

Commit

Permalink
Dialogs layout alignment - FormInit and FormClone
Browse files Browse the repository at this point in the history
* Add a new base dialog control `GitExtensionsDialog`that features two main
sections - `MainPanel` for the main content, and `ControlPanel` for all buttons.
All form should ideally inherit from this dialog to provide a consistent look
and feel.
* Update `FormInit` layout
* Update `FormClone` layout

Relates to #6183
  • Loading branch information
RussKie committed Jul 12, 2020
1 parent 7cba8ce commit ed70cd8
Show file tree
Hide file tree
Showing 9 changed files with 317 additions and 80 deletions.
58 changes: 24 additions & 34 deletions GitUI/CommandsDialogs/FormClone.Designer.cs

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

15 changes: 11 additions & 4 deletions GitUI/CommandsDialogs/FormClone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace GitUI.CommandsDialogs
{
public partial class FormClone : GitModuleForm
public partial class FormClone : GitExtensionsDialog
{
private readonly TranslationString _infoNewRepositoryLocation = new TranslationString("The repository will be cloned to a new directory located here:" + Environment.NewLine + "{0}");
private readonly TranslationString _infoDirectoryExists = new TranslationString("(Directory already exists)");
Expand All @@ -43,10 +43,15 @@ private FormClone()
}

public FormClone(GitUICommands commands, string url, bool openedFromProtocolHandler, EventHandler<GitModuleEventArgs> gitModuleChanged)
: base(commands)
: base(commands, enablePositionRestore: false)
{
_gitModuleChanged = gitModuleChanged;
InitializeComponent();

// work-around the designer bug that can't add controls to FlowLayoutPanel
ControlsPanel.Controls.Add(Ok);
ControlsPanel.Controls.Add(LoadSSHKey);

InitializeComplete();
_openedFromProtocolHandler = openedFromProtocolHandler;
_url = url;
Expand All @@ -68,8 +73,10 @@ protected override void OnRuntimeLoad(EventArgs e)
base.OnRuntimeLoad(e);

// scale up for hi DPI
MaximumSize = DpiUtil.Scale(new Size(950, 375));
MinimumSize = DpiUtil.Scale(new Size(450, 375));
MaximumSize = DpiUtil.Scale(new Size(950, 425));
MinimumSize = DpiUtil.Scale(new Size(450, 425));
Size = new Size((tableLayoutPanel2.Left * 2) + tableLayoutPanel2.Width, Height);
tableLayoutPanel2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;

ThreadHelper.JoinableTaskFactory.Run(async () =>
{
Expand Down
67 changes: 32 additions & 35 deletions GitUI/CommandsDialogs/FormInit.Designer.cs

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

Loading

0 comments on commit ed70cd8

Please sign in to comment.