Scrollbar visibility fix for when auto hide is disabled (#1067)

* Fix for scrollbar visibility when auto-hide is disabled

* Set the default opacity to 255 when the scrollbar auto hide is disabled since _opacity is unknown
This commit is contained in:
RH 2023-02-22 14:13:56 +11:00 committed by GitHub
parent 76b8747874
commit f3930a15f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -151,13 +151,18 @@ void ScrollViewBar::setWidth(float width)
void ScrollViewBar::setAutoHideEnabled(bool autoHideEnabled)
{
if (_autoHideEnabled == autoHideEnabled)
return;
_autoHideEnabled = autoHideEnabled;
if (!_autoHideEnabled && !_touching && _autoHideRemainingTime <= 0)
if (!_autoHideEnabled)
{
ProtectedNode::setOpacity(_opacity);
ProtectedNode::setOpacity(255);
}
else
else if (!_touching && _autoHideRemainingTime <= 0)
{
ProtectedNode::setOpacity(0);
}
}
float ScrollViewBar::getWidth() const