Fix clipping/overlap in lathe machine UIs (#26646)
* Add scrollbars to lathe material list when necessary * Fix bug where shrinking window would cause elements to overlap --------- Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Content.Client.Materials.UI;
|
||||
/// This widget is one row in the lathe eject menu.
|
||||
/// </summary>
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class MaterialStorageControl : BoxContainer
|
||||
public sealed partial class MaterialStorageControl : ScrollContainer
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
@@ -63,7 +63,7 @@ public sealed partial class MaterialStorageControl : BoxContainer
|
||||
}
|
||||
|
||||
var children = new List<MaterialDisplay>();
|
||||
children.AddRange(Children.OfType<MaterialDisplay>());
|
||||
children.AddRange(MaterialList.Children.OfType<MaterialDisplay>());
|
||||
|
||||
foreach (var display in children)
|
||||
{
|
||||
@@ -71,7 +71,7 @@ public sealed partial class MaterialStorageControl : BoxContainer
|
||||
|
||||
if (extra.Contains(mat))
|
||||
{
|
||||
RemoveChild(display);
|
||||
MaterialList.RemoveChild(display);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public sealed partial class MaterialStorageControl : BoxContainer
|
||||
foreach (var mat in missing)
|
||||
{
|
||||
var volume = mats[mat];
|
||||
AddChild(new MaterialDisplay(_owner.Value, mat, volume, canEject));
|
||||
MaterialList.AddChild(new MaterialDisplay(_owner.Value, mat, volume, canEject));
|
||||
}
|
||||
|
||||
_currentMaterials = mats;
|
||||
|
||||
Reference in New Issue
Block a user