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

Commit 764df01

Browse files
committed
Don't wrap summaries in the history view, for now
1 parent 20e2172 commit 764df01

File tree

1 file changed

+44
-2
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/Misc

1 file changed

+44
-2
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ class Styles
9090
hyperlinkStyle,
9191
selectedArea,
9292
selectedLabel,
93-
progressAreaBackStyle;
93+
progressAreaBackStyle,
94+
labelNoWrap,
95+
invisibleLabel;
9496

9597
private static Texture2D branchIcon,
9698
activeBranchIcon,
@@ -243,6 +245,46 @@ public static GUIStyle Label
243245
}
244246
}
245247

248+
public static GUIStyle LabelNoWrap
249+
{
250+
get
251+
{
252+
if (labelNoWrap == null)
253+
{
254+
labelNoWrap = new GUIStyle(GUI.skin.label);
255+
labelNoWrap.name = "LabelNoWrap";
256+
257+
var hierarchyStyle = GUI.skin.FindStyle("PR Label");
258+
labelNoWrap.onNormal.background = hierarchyStyle.onNormal.background;
259+
labelNoWrap.onNormal.textColor = hierarchyStyle.onNormal.textColor;
260+
labelNoWrap.onFocused.background = hierarchyStyle.onFocused.background;
261+
labelNoWrap.onFocused.textColor = hierarchyStyle.onFocused.textColor;
262+
labelNoWrap.wordWrap = false;
263+
}
264+
return labelNoWrap;
265+
}
266+
}
267+
268+
public static GUIStyle InvisibleLabel
269+
{
270+
get
271+
{
272+
if (invisibleLabel == null)
273+
{
274+
invisibleLabel = new GUIStyle(GUI.skin.label);
275+
invisibleLabel.name = "InvisibleLabel";
276+
277+
var hierarchyStyle = GUI.skin.FindStyle("PR Label");
278+
invisibleLabel.onNormal.background = hierarchyStyle.onNormal.background;
279+
invisibleLabel.onNormal.textColor = new Color(255, 0, 0, 0);
280+
invisibleLabel.onFocused.background = hierarchyStyle.onFocused.background;
281+
invisibleLabel.onFocused.textColor = new Color(255, 0, 0, 0);
282+
invisibleLabel.wordWrap = true;
283+
}
284+
return invisibleLabel;
285+
}
286+
}
287+
246288
public static GUIStyle SelectedLabel
247289
{
248290
get
@@ -475,7 +517,7 @@ public static GUIStyle HistoryEntrySummaryStyle
475517
{
476518
if (historyEntrySummaryStyle == null)
477519
{
478-
historyEntrySummaryStyle = new GUIStyle(Label);
520+
historyEntrySummaryStyle = new GUIStyle(LabelNoWrap);
479521
historyEntrySummaryStyle.name = "HistoryEntrySummaryStyle";
480522

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

0 commit comments

Comments
 (0)