Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit d0ac82e

Browse files
Correcting the scroll and setting the padding on the tree view
1 parent 06dd54e commit d0ac82e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,10 @@ public override void OnGUI()
483483

484484
rect = GUILayoutUtility.GetLastRect();
485485
GUILayout.BeginHorizontal(Styles.HistoryFileTreeBoxStyle);
486+
GUILayout.BeginVertical();
486487
{
487-
var treeControlRect = new Rect(rect.x, rect.y, Position.width, Position.height - rect.height + Styles.CommitAreaPadding);
488+
var borderLeft = Styles.Label.margin.left;
489+
var treeControlRect = new Rect(rect.x + borderLeft, rect.y, Position.width - borderLeft * 2, Position.height - rect.height + Styles.CommitAreaPadding);
488490
var treeRect = Rect.zero;
489491
if (treeChanges != null)
490492
{
@@ -507,6 +509,7 @@ public override void OnGUI()
507509

508510
GUILayout.Space(treeRect.y - treeControlRect.y);
509511
}
512+
GUILayout.EndVertical();
510513
GUILayout.EndHorizontal();
511514

512515
GUILayout.Space(EditorGUIUtility.standardVerticalSpacing);
@@ -518,7 +521,7 @@ public override void OnGUI()
518521
private void HistoryDetailsEntry(GitLogEntry entry)
519522
{
520523
GUILayout.BeginVertical(Styles.HeaderBoxStyle);
521-
GUILayout.Label(entry.Summary, Styles.HistoryDetailsTitleStyle, GUILayout.Width(Position.width));
524+
GUILayout.Label(entry.Summary, Styles.HistoryDetailsTitleStyle);
522525

523526
GUILayout.Space(-5);
524527

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public TreeNodeRenderResult Render(Rect rect, float indentation, bool isSelected
424424
return renderResult;
425425

426426
var fillRect = rect;
427-
var nodeStartX = Level * indentation;
427+
var nodeStartX = Level * indentation + rect.x;
428428
nodeStartX += 2 * level;
429429

430430
var nodeRect = new Rect(nodeStartX, rect.y, fillRect.width - nodeStartX, rect.height);

0 commit comments

Comments
 (0)