mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Adds setters on SS14Window for styling header & title (#2232)
Co-authored-by: T <tomeno@lulzsec.co.uk>
This commit is contained in:
@@ -18,6 +18,9 @@ namespace Robust.Client.UserInterface.CustomControls
|
||||
public const string StyleClassWindowHeader = "windowHeader";
|
||||
public const string StyleClassWindowCloseButton = "windowCloseButton";
|
||||
|
||||
private string? _headerClass;
|
||||
private string? _titleClass;
|
||||
|
||||
public SS14Window()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
@@ -31,6 +34,42 @@ namespace Robust.Client.UserInterface.CustomControls
|
||||
XamlChildren = new SS14ContentCollection(this);
|
||||
}
|
||||
|
||||
public string? HeaderClass
|
||||
{
|
||||
get => _headerClass;
|
||||
set
|
||||
{
|
||||
if (_headerClass == value)
|
||||
return;
|
||||
|
||||
if (_headerClass != null)
|
||||
WindowHeader.RemoveStyleClass(_headerClass);
|
||||
|
||||
if (value != null)
|
||||
WindowHeader.AddStyleClass(value);
|
||||
|
||||
_headerClass = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string? TitleClass
|
||||
{
|
||||
get => _titleClass;
|
||||
set
|
||||
{
|
||||
if (_titleClass == value)
|
||||
return;
|
||||
|
||||
if (_titleClass != null)
|
||||
TitleLabel.RemoveStyleClass(_titleClass);
|
||||
|
||||
if (value != null)
|
||||
TitleLabel.AddStyleClass(value);
|
||||
|
||||
_titleClass = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Control Contents { get; private set; }
|
||||
|
||||
private const int DRAG_MARGIN_SIZE = 7;
|
||||
|
||||
Reference in New Issue
Block a user