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

Commit 792a1ad

Browse files
Removing broadmode code
1 parent ccfeef3 commit 792a1ad

File tree

2 files changed

+2
-106
lines changed

2 files changed

+2
-106
lines changed

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

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,8 @@ private void HandleRepositoryBranchChangeEvent(string obj)
110110
public override void Refresh()
111111
{
112112
base.Refresh();
113-
var historyView = ((Window)Parent).HistoryTab;
114113

115-
#if ENABLE_BROADMODE
116-
if (historyView.BroadMode)
117-
historyView.Refresh();
118-
else
119-
#endif
120-
RefreshEmbedded();
114+
RefreshEmbedded();
121115
}
122116

123117
public void RefreshEmbedded()
@@ -131,23 +125,7 @@ public void RefreshEmbedded()
131125

132126
public override void OnGUI()
133127
{
134-
var historyView = ((Window)Parent).HistoryTab;
135-
136-
#if ENABLE_BROADMODE
137-
if (historyView.BroadMode)
138-
historyView.OnGUI();
139-
else
140-
#endif
141-
{
142-
OnEmbeddedGUI();
143-
144-
#if ENABLE_BROADMODE
145-
if (Event.current.type == EventType.Repaint && historyView.EvaluateBroadMode())
146-
{
147-
Refresh();
148-
}
149-
#endif
150-
}
128+
OnEmbeddedGUI();
151129
}
152130

153131
public void OnEmbeddedGUI()

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

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ class HistoryView : Subview
4848
[NonSerialized] private bool updated = true;
4949
[NonSerialized] private bool useScrollTime;
5050

51-
#if ENABLE_BROADMODE
52-
[SerializeField] private bool broadMode;
53-
#endif
5451
[SerializeField] private Vector2 detailsScroll;
5552
[SerializeField] private Object historyTarget;
5653
[SerializeField] private Vector2 scroll;
@@ -106,12 +103,6 @@ public override void Refresh()
106103
{
107104
base.Refresh();
108105
RefreshLog();
109-
#if ENABLE_BROADMODE
110-
if (broadMode)
111-
{
112-
((Window)Parent).BranchesTab.RefreshEmbedded();
113-
}
114-
#endif
115106
}
116107

117108
public override void OnSelectionChange()
@@ -131,44 +122,8 @@ public override void OnGUI()
131122
return;
132123
}
133124

134-
#if ENABLE_BROADMODE
135-
if (broadMode)
136-
OnBroadGUI();
137-
else
138-
#endif
139125
OnEmbeddedGUI();
140-
141-
#if ENABLE_BROADMODE
142-
if (Event.current.type == EventType.Repaint && EvaluateBroadMode())
143-
{
144-
Refresh();
145-
}
146-
#endif
147126
}
148-
149-
#if ENABLE_BROADMODE
150-
public void OnBroadGUI()
151-
{
152-
GUILayout.BeginHorizontal();
153-
{
154-
GUILayout.BeginVertical(
155-
GUILayout.MinWidth(Styles.BroadModeBranchesMinWidth),
156-
GUILayout.MaxWidth(Mathf.Max(Styles.BroadModeBranchesMinWidth, Position.width * Styles.BroadModeBranchesRatio))
157-
);
158-
{
159-
((Window)Parent).BranchesTab.OnEmbeddedGUI();
160-
}
161-
GUILayout.EndVertical();
162-
GUILayout.BeginVertical();
163-
{
164-
OnEmbeddedGUI();
165-
}
166-
GUILayout.EndVertical();
167-
}
168-
GUILayout.EndHorizontal();
169-
}
170-
#endif
171-
172127
private void AttachHandlers(IRepository repository)
173128
{
174129
if (repository == null)
@@ -793,43 +748,6 @@ private void DrawTimelineRectAroundIconRect(Rect parentRect, Rect iconRect)
793748
EditorGUI.DrawRect(bottomTimelineRect, timelineBarColor);
794749
}
795750

796-
#if ENABLE_BROADMODE
797-
private bool EvaluateBroadMode()
798-
{
799-
var past = broadMode;
800-
801-
// Flip when the limits are breached
802-
if (Position.width > Styles.BroadModeLimit)
803-
{
804-
broadMode = true;
805-
}
806-
else if (Position.width < Styles.NarrowModeLimit)
807-
{
808-
broadMode = false;
809-
}
810-
811-
// Show the layout notification while scaling
812-
var window = (Window)Parent;
813-
var scaled = Position.width != lastWidth;
814-
lastWidth = Position.width;
815-
816-
if (scaled)
817-
{
818-
window.ShowNotification(new GUIContent(Styles.FolderIcon), Styles.ModeNotificationDelay);
819-
}
820-
821-
// Return whether we flipped
822-
return broadMode != past;
823-
}
824-
#endif
825-
826-
#if ENABLE_BROADMODE
827-
public bool BroadMode
828-
{
829-
get { return broadMode; }
830-
}
831-
#endif
832-
833751
private float EntryHeight
834752
{
835753
get { return Styles.HistoryEntryHeight + Styles.HistoryEntryPadding; }

0 commit comments

Comments
 (0)