Placeholder.cs 763 B

1234567891011121314151617181920212223242526272829
  1. using Robust.Client.UserInterface.Controls;
  2. namespace Content.Client.UserInterface.Controls
  3. {
  4. public sealed class Placeholder : PanelContainer
  5. {
  6. public const string StyleClassPlaceholderText = "PlaceholderText";
  7. private readonly Label _label;
  8. public string? PlaceholderText
  9. {
  10. get => _label.Text;
  11. set => _label.Text = value;
  12. }
  13. public Placeholder()
  14. {
  15. _label = new Label
  16. {
  17. VerticalAlignment = VAlignment.Stretch,
  18. Align = Label.AlignMode.Center,
  19. VAlign = Label.VAlignMode.Center
  20. };
  21. _label.AddStyleClass(StyleClassPlaceholderText);
  22. AddChild(_label);
  23. }
  24. }
  25. }