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

Commit 79b98eb

Browse files
Merge pull request #354 from github-for-unity/fixes/disable-selected-asset-history-view
Disabling focusing action in HistoryView
2 parents 1a23457 + a70bb04 commit 79b98eb

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

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

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ namespace GitHub.Unity
1212
[Serializable]
1313
class HistoryView : Subview
1414
{
15-
private const string HistoryFocusAll = "(All)";
16-
private const string HistoryFocusSingle = "Focus: <b>{0}</b>";
1715
private const string PullButton = "Pull";
1816
private const string PullButtonCount = "Pull (<b>{0}</b>)";
1917
private const string PushButton = "Push";
@@ -48,7 +46,6 @@ class HistoryView : Subview
4846
[NonSerialized] private bool isBusy;
4947

5048
[SerializeField] private Vector2 detailsScroll;
51-
[SerializeField] private Object historyTarget;
5249
[SerializeField] private Vector2 scroll;
5350
[SerializeField] private string selectionID;
5451
[SerializeField] private int statusAhead;
@@ -99,10 +96,7 @@ public override void OnRepositoryChanged(IRepository oldRepository)
9996

10097
public override void OnSelectionChange()
10198
{
102-
if (!string.IsNullOrEmpty(AssetDatabase.GetAssetPath(Selection.activeObject)))
103-
{
104-
historyTarget = Selection.activeObject;
105-
}
99+
106100
}
107101

108102
public override void OnGUI()
@@ -215,20 +209,6 @@ public void OnEmbeddedGUI()
215209
// History toolbar
216210
GUILayout.BeginHorizontal(EditorStyles.toolbar);
217211
{
218-
// Target indicator / clear button
219-
EditorGUI.BeginDisabledGroup(historyTarget == null);
220-
{
221-
if (GUILayout.Button(
222-
historyTarget == null ? HistoryFocusAll : String.Format(HistoryFocusSingle, historyTarget.name),
223-
Styles.HistoryToolbarButtonStyle)
224-
)
225-
{
226-
historyTarget = null;
227-
Refresh();
228-
}
229-
}
230-
EditorGUI.EndDisabledGroup();
231-
232212
GUILayout.FlexibleSpace();
233213

234214
if (isPublished)
@@ -431,7 +411,7 @@ private void ScrollTo(int index, float offset = 0f)
431411

432412
private LogEntryState GetEntryState(int index)
433413
{
434-
return historyTarget == null ? (index < statusAhead ? LogEntryState.Local : LogEntryState.Normal) : LogEntryState.Normal;
414+
return index < statusAhead ? LogEntryState.Local : LogEntryState.Normal;
435415
}
436416

437417
/// <summary>

0 commit comments

Comments
 (0)