Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
17 changes: 17 additions & 0 deletions src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Styles
headerDescriptionStyle,
historyToolbarButtonStyle,
historyLockStyle,
historyEntrySummaryStyle,
historyEntryDetailsStyle,
historyEntryDetailsRightStyle,
historyFileTreeBoxStyle,
Expand Down Expand Up @@ -396,6 +397,20 @@ public static GUIStyle HistoryLockStyle
return historyLockStyle;
}
}
public static GUIStyle HistoryEntrySummaryStyle
{
get
{
if (historyEntrySummaryStyle == null)
{
historyEntrySummaryStyle = new GUIStyle(Label);
historyEntrySummaryStyle.name = "HistoryEntrySummaryStyle";

historyEntrySummaryStyle.contentOffset = new Vector2(BaseSpacing * 2, 0);
}
return historyEntrySummaryStyle;
}
}

public static GUIStyle HistoryEntryDetailsStyle
{
Expand All @@ -412,6 +427,8 @@ public static GUIStyle HistoryEntryDetailsStyle
historyEntryDetailsStyle.onNormal.textColor = Label.onNormal.textColor;
historyEntryDetailsStyle.onFocused.background = Label.onFocused.background;
historyEntryDetailsStyle.onFocused.textColor = Label.onFocused.textColor;

historyEntryDetailsStyle.contentOffset = new Vector2(BaseSpacing * 2, 0);
}
return historyEntryDetailsStyle;
}
Expand Down
14 changes: 9 additions & 5 deletions src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ class ChangesView : Subview
[SerializeField] private string commitBody = "";
[SerializeField] private string commitMessage = "";
[SerializeField] private string currentBranch = "[unknown]";
[SerializeField] private Vector2 scroll;
[SerializeField] private CacheUpdateEvent lastCurrentBranchChangedEvent;
[SerializeField] private CacheUpdateEvent lastStatusEntriesChangedEvent;

[SerializeField] private Vector2 treeScroll;
[SerializeField] private ChangesTree treeChanges;

[SerializeField] private List<GitStatusEntry> gitStatusEntries;

[SerializeField] private string changedFilesText = NoChangedFilesLabel;

[SerializeField] private CacheUpdateEvent lastCurrentBranchChangedEvent;
[SerializeField] private CacheUpdateEvent lastStatusEntriesChangedEvent;

public override void OnEnable()
{
base.OnEnable();
Expand Down Expand Up @@ -81,7 +85,7 @@ public override void OnGUI()
GUILayout.BeginHorizontal();
GUILayout.BeginVertical(Styles.CommitFileAreaStyle);
{
scroll = GUILayout.BeginScrollView(scroll);
treeScroll = GUILayout.BeginScrollView(treeScroll);
{
OnTreeGUI(new Rect(0f, 0f, Position.width, Position.height - rect.height + Styles.CommitAreaPadding));
}
Expand Down Expand Up @@ -110,7 +114,7 @@ private void OnTreeGUI(Rect rect)
treeChanges.FocusedTreeNodeStyle = Styles.FocusedTreeNode;
treeChanges.FocusedActiveTreeNodeStyle = Styles.FocusedActiveTreeNode;

var treeRenderRect = treeChanges.Render(rect, scroll,
var treeRenderRect = treeChanges.Render(rect, treeScroll,
node => { },
node => { },
node => { });
Expand Down
Loading