Add difference for folders.

This commit is contained in:
Chandler Cox
2023-09-01 16:37:14 -05:00
parent 53861c4795
commit 67909e33c8

View File

@@ -683,13 +683,31 @@ namespace FlaxEditor.Content
thumbnailRect = new Rectangle(0, 0, thumbnailSize, thumbnailSize); thumbnailRect = new Rectangle(0, 0, thumbnailSize, thumbnailSize);
nameAlignment = TextAlignment.Center; nameAlignment = TextAlignment.Center;
if (this is ContentFolder)
{
// Small shadow
var shadowRect = new Rectangle(2, 2, clientRect.Width + 1, clientRect.Height + 1);
var color = Color.Black.AlphaMultiplied(0.2f);
Render2D.FillRectangle(shadowRect, color);
Render2D.FillRectangle(clientRect, style.Background.RGBMultiplied(1.25f));
if (isSelected)
Render2D.FillRectangle(clientRect, Parent.ContainsFocus ? style.BackgroundSelected : style.LightBackground);
else if (IsMouseOver)
Render2D.FillRectangle(clientRect, style.BackgroundHighlighted);
DrawThumbnail(ref thumbnailRect, false);
}
else
{
// Small shadow // Small shadow
var shadowRect = new Rectangle(2, 2, clientRect.Width + 1, clientRect.Height + 1); var shadowRect = new Rectangle(2, 2, clientRect.Width + 1, clientRect.Height + 1);
var color = Color.Black.AlphaMultiplied(0.2f); var color = Color.Black.AlphaMultiplied(0.2f);
Render2D.FillRectangle(shadowRect, color); Render2D.FillRectangle(shadowRect, color);
Render2D.FillRectangle(clientRect, style.LightBackground); Render2D.FillRectangle(clientRect, style.Background.RGBMultiplied(1.25f));
Render2D.FillRectangle(TextRectangle, style.TextBoxBackground); Render2D.FillRectangle(TextRectangle, style.LightBackground);
var accentHeight = 2 * view.ViewScale; var accentHeight = 2 * view.ViewScale;
var barRect = new Rectangle(0, thumbnailRect.Height - accentHeight, clientRect.Width, accentHeight); var barRect = new Rectangle(0, thumbnailRect.Height - accentHeight, clientRect.Width, accentHeight);
Render2D.FillRectangle(barRect, Color.DimGray); Render2D.FillRectangle(barRect, Color.DimGray);
@@ -705,6 +723,7 @@ namespace FlaxEditor.Content
Render2D.FillRectangle(textRect, style.BackgroundHighlighted); Render2D.FillRectangle(textRect, style.BackgroundHighlighted);
Render2D.DrawRectangle(clientRect, style.BackgroundHighlighted); Render2D.DrawRectangle(clientRect, style.BackgroundHighlighted);
} }
}
break; break;
} }
case ContentViewType.List: case ContentViewType.List: