Item status!

This commit is contained in:
Pieter-Jan Briers
2020-01-09 00:27:52 +01:00
parent e984fc24b6
commit 411c23c46e
36 changed files with 1248 additions and 128 deletions

View File

@@ -30,11 +30,14 @@ namespace Content.Client.UserInterface
public const string StyleClassPowerStateLow = "PowerStateLow";
public const string StyleClassPowerStateGood = "PowerStateGood";
public const string StyleClassItemStatus = "ItemStatus";
public Stylesheet Stylesheet { get; }
public NanoStyle()
{
var resCache = IoCManager.Resolve<IResourceCache>();
var notoSans8 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 8);
var notoSans10 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 10);
var notoSans12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Regular.ttf", 12);
var notoSansBold12 = resCache.GetFont("/Nano/NotoSans/NotoSans-Bold.ttf", 12);
@@ -108,7 +111,8 @@ namespace Content.Client.UserInterface
var vScrollBarGrabberNormal = new StyleBoxFlat
{
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginLeftOverride = 10, ContentMarginTopOverride = 10
BackgroundColor = Color.Gray.WithAlpha(0.35f), ContentMarginLeftOverride = 10,
ContentMarginTopOverride = 10
};
var vScrollBarGrabberHover = new StyleBoxFlat
{
@@ -175,7 +179,7 @@ namespace Content.Client.UserInterface
var itemListItemBackground = new StyleBoxFlat {BackgroundColor = new Color(55, 55, 68)};
itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListItemBackground.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
var itemListItemBackgroundTransparent = new StyleBoxFlat { BackgroundColor = Color.Transparent };
var itemListItemBackgroundTransparent = new StyleBoxFlat {BackgroundColor = Color.Transparent};
itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Vertical, 2);
itemListItemBackgroundTransparent.SetContentMarginOverride(StyleBox.Margin.Horizontal, 4);
@@ -437,7 +441,7 @@ namespace Content.Client.UserInterface
itemListBackgroundSelected)
}),
new StyleRule(new SelectorElement(typeof(ItemList), new []{"transparentItemList"}, null, null), new[]
new StyleRule(new SelectorElement(typeof(ItemList), new[] {"transparentItemList"}, null, null), new[]
{
new StyleProperty(ItemList.StylePropertyBackground,
new StyleBoxFlat {BackgroundColor = Color.Transparent}),
@@ -482,11 +486,12 @@ namespace Content.Client.UserInterface
}),
// Bigger Label
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold20),
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
}),
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelHeadingBigger}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold20),
new StyleProperty(Label.StylePropertyFontColor, NanoGold),
}),
// Small Label
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSubText}, null, null), new[]
@@ -496,17 +501,18 @@ namespace Content.Client.UserInterface
}),
// Label Key
new StyleRule(new SelectorElement(typeof(Label), new []{StyleClassLabelKeyText}, null, null), new []
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelKeyText}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSansBold12),
new StyleProperty(Label.StylePropertyFontColor, NanoGold)
}),
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null), new[]
{
new StyleProperty(Label.StylePropertyFont, notoSans12),
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
}),
new StyleRule(new SelectorElement(typeof(Label), new[] {StyleClassLabelSecondaryColor}, null, null),
new[]
{
new StyleProperty(Label.StylePropertyFont, notoSans12),
new StyleProperty(Label.StylePropertyFontColor, Color.DarkGray),
}),
// Big Button
new StyleRule(new SelectorElement(typeof(Button), new[] {StyleClassButtonBig}, null, null), new[]
@@ -596,7 +602,7 @@ namespace Content.Client.UserInterface
// StripeBack
new StyleRule(
SelectorElement.Type(typeof(StripeBack)),
new []
new[]
{
new StyleProperty(StripeBack.StylePropertyBackground, stripeBack),
}),
@@ -604,10 +610,16 @@ namespace Content.Client.UserInterface
// StyleClassLabelBig
new StyleRule(
SelectorElement.Class(StyleClassLabelBig),
new []
new[]
{
new StyleProperty("font", notoSans16),
}),
// StyleClassItemStatus
new StyleRule(SelectorElement.Class(StyleClassItemStatus), new[]
{
new StyleProperty("font", notoSans10),
}),
});
}
}