Skip to content

Commit

Permalink
Add borders in Commit Form and set splitter width like in VS
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangrek committed Feb 18, 2021
1 parent 424ccf2 commit 983b0c3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GitExtUtils/GitUI/ControlDpiExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void AdjustForDpiScaling(this Control control)

case SplitContainer splitContainer:
{
const int splitterWidth = 8;
const int splitterWidth = 6;

if (!isDpiScaled)
{
Expand Down
4 changes: 2 additions & 2 deletions GitUI/CommandsDialogs/FormBrowse.Designer.cs

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

6 changes: 6 additions & 0 deletions GitUI/CommandsDialogs/FormCommit.Designer.cs

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

15 changes: 15 additions & 0 deletions GitUI/CommandsDialogs/FormCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ public FormCommit([NotNull] GitUICommands commands, CommitKind commitKind = Comm

toolStripStatusBranchIcon.AdaptImageLightness();

splitLeft.Panel1.BackColor = Color.LightGray.AdaptBackColor();
splitLeft.Panel2.BackColor = Color.LightGray.AdaptBackColor();
splitRight.Panel1.BackColor = Color.LightGray.AdaptBackColor();
splitRight.Panel2.BackColor = Color.LightGray.AdaptBackColor();

WorkaroundPaddingIncreaseBug();

InitializeComplete();

// By calling this in the constructor, we prevent flickering caused by resizing the
Expand Down Expand Up @@ -380,6 +387,14 @@ void ConfigureMessageBox()
? _enterCommitMessageHint.Text
: _commitMessageDisabled.Text;
}

void WorkaroundPaddingIncreaseBug()
{
splitLeft.Panel1.Padding = new Padding(1);
splitLeft.Panel2.Padding = new Padding(1);
splitRight.Panel1.Padding = new Padding(1);
splitRight.Panel2.Padding = new Padding(1);
}
}

protected override void Dispose(bool disposing)
Expand Down

0 comments on commit 983b0c3

Please sign in to comment.