mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
ItemList only shows scrollbar when necessary.
This commit is contained in:
@@ -64,6 +64,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
}
|
||||
|
||||
_scrollBar.MaxValue = Math.Max(_scrollBar.Page, _totalContentHeight);
|
||||
_updateScrollbarVisibility();
|
||||
}
|
||||
|
||||
public void AddItem(string text, Texture icon = null, bool selectable = true)
|
||||
@@ -480,6 +481,11 @@ namespace Robust.Client.UserInterface.Controls
|
||||
base.UIScaleChanged();
|
||||
}
|
||||
|
||||
private void _updateScrollbarVisibility()
|
||||
{
|
||||
_scrollBar.Visible = _totalContentHeight + ActualBackground.MinimumSize.Y > PixelHeight;
|
||||
}
|
||||
|
||||
public sealed class Item
|
||||
{
|
||||
public string Text = null;
|
||||
|
||||
Reference in New Issue
Block a user