Add fancy tree control (#13426)

* Add fancy tree control

* inject dependencies
This commit is contained in:
Leon Friedrich
2023-01-16 19:45:46 +13:00
committed by GitHub
parent aacdb2ad0c
commit 4102c9cf7c
11 changed files with 626 additions and 0 deletions

View File

@@ -113,6 +113,11 @@ namespace Content.Client.Stylesheets
public static readonly Color ExamineButtonColorContextPressed = Color.LightSlateGray;
public static readonly Color ExamineButtonColorContextDisabled = Color.FromHex("#5A5A5A");
// Fancy Tree elements
public static readonly Color FancyTreeEvenRowColor = Color.FromHex("#25252A");
public static readonly Color FancyTreeOddRowColor = FancyTreeEvenRowColor * new Color(0.8f, 0.8f, 0.8f);
public static readonly Color FancyTreeSelectedRowColor = new Color(55, 55, 68);
//Used by the APC and SMES menus
public const string StyleClassPowerStateNone = "PowerStateNone";
public const string StyleClassPowerStateLow = "PowerStateLow";
@@ -1408,6 +1413,35 @@ namespace Content.Client.Stylesheets
.Prop(Label.StylePropertyFont, notoSans10)
.Prop(Label.StylePropertyFontColor, Color.FromHex("#333d3b")),
// Fancy Tree
Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
.Class(TreeItem.StyleClassEvenRow)
.Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = FancyTreeEvenRowColor,
}),
Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
.Class(TreeItem.StyleClassOddRow)
.Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = FancyTreeOddRowColor,
}),
Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
.Class(TreeItem.StyleClassSelected)
.Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = FancyTreeSelectedRowColor,
}),
Element<ContainerButton>().Identifier(TreeItem.StyleIdentifierTreeButton)
.Pseudo(ContainerButton.StylePseudoClassHover)
.Prop(ContainerButton.StylePropertyStyleBox, new StyleBoxFlat
{
BackgroundColor = FancyTreeSelectedRowColor,
}),
}).ToList());
}
}