Do not open dropdown menu scrolled to the bottom

This commit is contained in:
Sergii Pylypenko
2019-07-17 23:35:26 +03:00
committed by pelya
parent fea9bb1c24
commit b82dd5d0c2
2 changed files with 2 additions and 3 deletions

View File

@@ -149,6 +149,7 @@ struct DropdownWindow : Window {
/* Capacity is the average number of items visible */
this->vscroll->SetCapacity(size.height * (uint16)list->Length() / list_height);
this->vscroll->SetCount((uint16)list->Length());
this->vscroll->SetPosition(Clamp(selected, 0, list->Length()));
this->parent_wnd_class = parent->window_class;
this->parent_wnd_num = parent->window_number;
@@ -427,7 +428,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
/* The dropdown starts scrolling downwards when opening it towards
* the top and holding down the mouse button. It can be fooled by
* opening the dropdown scrolled to the very bottom. */
if (above && scroll) dropdown->vscroll->UpdatePosition(INT_MAX);
//if (above && scroll) dropdown->vscroll->UpdatePosition(INT_MAX);
}
/**

View File

@@ -11,7 +11,5 @@
- Select native screen width x 480 resolution on first run.
- Scrollable lists open scrolled to bottom.
- Two-finger scroll when building road is broken.