mirror of https://github.com/buggins/dlangui.git
Complete fix dlanguide 236 scrollbar bug.
This commit is contained in:
parent
6ab38d89e5
commit
d394cfd8ac
|
@ -1171,9 +1171,15 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
|
||||||
if (_lastMeasureWidth != rc.width || _lastMeasureHeight != rc.height)
|
if (_lastMeasureWidth != rc.width || _lastMeasureHeight != rc.height)
|
||||||
measure(parentrc.width, parentrc.height);
|
measure(parentrc.width, parentrc.height);
|
||||||
|
|
||||||
// hide scrollbar or update rc for scrollbar
|
// layout scrollbar
|
||||||
Rect sbrect = rc;
|
|
||||||
if (_needScrollbar) {
|
if (_needScrollbar) {
|
||||||
|
_scrollbar.visibility = Visibility.Visible;
|
||||||
|
Rect sbrect = rc;
|
||||||
|
if (_orientation == Orientation.Vertical)
|
||||||
|
sbrect.left = sbrect.right - _sbsz.x;
|
||||||
|
else
|
||||||
|
sbrect.top = sbrect.bottom - _sbsz.y;
|
||||||
|
_scrollbar.layout(sbrect);
|
||||||
rc.right -= _sbsz.x;
|
rc.right -= _sbsz.x;
|
||||||
rc.bottom -= _sbsz.y;
|
rc.bottom -= _sbsz.y;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1185,16 +1191,6 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
|
||||||
// calc item rectangles
|
// calc item rectangles
|
||||||
updateItemPositions();
|
updateItemPositions();
|
||||||
|
|
||||||
// layout scrollbar - must be under updateItemPositions()
|
|
||||||
if (_needScrollbar) {
|
|
||||||
_scrollbar.visibility = Visibility.Visible;
|
|
||||||
if (_orientation == Orientation.Vertical)
|
|
||||||
sbrect.left = sbrect.right - _sbsz.x;
|
|
||||||
else
|
|
||||||
sbrect.top = sbrect.bottom - _sbsz.y;
|
|
||||||
_scrollbar.layout(sbrect);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_makeSelectionVisibleOnNextLayout) {
|
if (_makeSelectionVisibleOnNextLayout) {
|
||||||
makeSelectionVisible();
|
makeSelectionVisible();
|
||||||
_makeSelectionVisibleOnNextLayout = false;
|
_makeSelectionVisibleOnNextLayout = false;
|
||||||
|
|
|
@ -418,7 +418,9 @@ class ScrollBar : AbstractSlider, OnClickHandler {
|
||||||
_btnBack.setState(State.Enabled);
|
_btnBack.setState(State.Enabled);
|
||||||
_btnForward.setState(State.Enabled);
|
_btnForward.setState(State.Enabled);
|
||||||
_indicator.visibility = Visibility.Visible;
|
_indicator.visibility = Visibility.Visible;
|
||||||
|
if (_position > _minValue)
|
||||||
_pageUp.visibility = Visibility.Visible;
|
_pageUp.visibility = Visibility.Visible;
|
||||||
|
if (_position < _maxValue)
|
||||||
_pageDown.visibility = Visibility.Visible;
|
_pageDown.visibility = Visibility.Visible;
|
||||||
} else {
|
} else {
|
||||||
_btnBack.resetState(State.Enabled);
|
_btnBack.resetState(State.Enabled);
|
||||||
|
|
Loading…
Reference in New Issue