Remove encapsulation for previously protected XAML UI fields (#4975)

This commit is contained in:
Visne
2021-10-28 14:23:17 +02:00
committed by GitHub
parent aed66cfc48
commit ac78145b94
49 changed files with 158 additions and 202 deletions

View File

@@ -112,7 +112,7 @@ namespace Content.Client.Alerts
{
_alertControls.Remove(alertKeyToRemove, out var control);
if (control == null) return;
_ui.Grid.Children.Remove(control);
_ui.AlertContainer.Children.Remove(control);
}
// now we know that alertControls contains alerts that should still exist but
@@ -145,7 +145,7 @@ namespace Content.Client.Alerts
{
if (existingAlertControl != null)
{
_ui.Grid.Children.Remove(existingAlertControl);
_ui.AlertContainer.Children.Remove(existingAlertControl);
}
// this is a new alert + alert key or just a different alert with the same
@@ -154,12 +154,12 @@ namespace Content.Client.Alerts
if (_alertOrder != null)
{
var added = false;
foreach (var alertControl in _ui.Grid.Children)
foreach (var alertControl in _ui.AlertContainer.Children)
{
if (_alertOrder.Compare(newAlert, ((AlertControl) alertControl).Alert) < 0)
{
var idx = alertControl.GetPositionInParent();
_ui.Grid.Children.Add(newAlertControl);
_ui.AlertContainer.Children.Add(newAlertControl);
newAlertControl.SetPositionInParent(idx);
added = true;
break;
@@ -168,12 +168,12 @@ namespace Content.Client.Alerts
if (!added)
{
_ui.Grid.Children.Add(newAlertControl);
_ui.AlertContainer.Children.Add(newAlertControl);
}
}
else
{
_ui.Grid.Children.Add(newAlertControl);
_ui.AlertContainer.Children.Add(newAlertControl);
}
_alertControls[newAlert.AlertKey] = newAlertControl;

View File

@@ -3,7 +3,7 @@
<PanelContainer StyleClasses="TransparentBorderedWindowPanel"
HorizontalAlignment="Right"
VerticalAlignment="Top">
<GridContainer Name="AlertContainer" MaxGridHeight="64" ExpandBackwards="True">
<GridContainer Name="AlertContainer" Access="Public" MaxGridHeight="64" ExpandBackwards="True">
</GridContainer>
</PanelContainer>

View File

@@ -18,8 +18,6 @@ namespace Content.Client.Alerts.UI
public const float ChatSeparation = 38f;
public GridContainer Grid => AlertContainer;
public AlertsUI()
{
IoCManager.InjectDependencies(this);