mirror of https://github.com/buggins/dlangui.git
ListWidget - scrollbar.layout() after updateItemPositions() is needed by ComboBox.
This commit is contained in:
parent
d394cfd8ac
commit
e94e89d4d7
src/dlangui/widgets
|
@ -1171,15 +1171,10 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
|
|||
if (_lastMeasureWidth != rc.width || _lastMeasureHeight != rc.height)
|
||||
measure(parentrc.width, parentrc.height);
|
||||
|
||||
// hide scrollbar or update rc for scrollbar
|
||||
Rect sbrect = rc;
|
||||
// layout scrollbar
|
||||
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.bottom -= _sbsz.y;
|
||||
} else {
|
||||
|
@ -1191,6 +1186,16 @@ class ListWidget : WidgetGroup, OnScrollHandler, OnAdapterChangeHandler {
|
|||
// calc item rectangles
|
||||
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) {
|
||||
makeSelectionVisible();
|
||||
_makeSelectionVisibleOnNextLayout = false;
|
||||
|
|
Loading…
Reference in New Issue