Skip to content

Commit cb29238

Browse files
committed
Merge branch 'Development'
2 parents f7c1224 + aa31cdf commit cb29238

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

Editor/ProjectFolder/ProjectFavoritesOverlayManager.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ private static int DrawPagedFavorites(Rect listRect, Event evt)
602602
}
603603

604604
if (!(_isRowReorderDrag && itemIndex == _dragSourceIndex))
605-
DrawRowVisual(item, rowRect, localMouse);
605+
DrawRowVisual(item, rowRect, localMouse, pageSlot);
606606
rowIndex++;
607607
}
608608
GUI.EndGroup();
@@ -846,7 +846,7 @@ private static void DrawRow(FavoriteItem item, int itemIndex, Rect rowRect, Even
846846
}
847847
}
848848

849-
private static void DrawRowVisual(FavoriteItem item, Rect rowRect, Vector2 mousePosition)
849+
private static void DrawRowVisual(FavoriteItem item, Rect rowRect, Vector2 mousePosition, int zebraIndex = -1)
850850
{
851851
bool isHover = rowRect.Contains(mousePosition);
852852
bool isSelected = IsItemSelected(item);
@@ -856,6 +856,23 @@ private static void DrawRowVisual(FavoriteItem item, Rect rowRect, Vector2 mouse
856856
bool hasFolderColor = isFolder && ProjectFolderStyleManager.TryGetColorForFolderPath(itemPath, out folderColor);
857857
bool drawRowTint = hasFolderColor && NMPSettings.ProjectRowColors;
858858
bool drawIconTint = hasFolderColor && NMPSettings.ProjectFolderColors;
859+
bool drawZebra = NMPSettings.ProjectZebra && !drawRowTint;
860+
if (drawZebra)
861+
{
862+
bool isOdd;
863+
if (zebraIndex >= 0)
864+
isOdd = (zebraIndex & 1) != 0;
865+
else
866+
isOdd = Mathf.RoundToInt(rowRect.y / Mathf.Max(1f, rowRect.height)) % 2 != 0;
867+
868+
if (isOdd)
869+
{
870+
var zebraColor = EditorGUIUtility.isProSkin
871+
? new Color(1f, 1f, 1f, 0.07f)
872+
: new Color(0f, 0f, 0f, 0.07f);
873+
EditorGUI.DrawRect(rowRect, zebraColor);
874+
}
875+
}
859876

860877
if (drawRowTint)
861878
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.nomorepain.editor",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"displayName": "No More Pain Editor",
55
"description": "Unity Editor productivity tools: Inspector Tabs, Play Mode Save, Component Copy/Paste and more.",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)