Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Guichan's changes from 6725f3b08248d94e3ac11ce530aec42e3029fc62… #67

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply Guichan's changes from 6725f3b08248d94e3ac11ce530aec42e3029fc62…
… (Sept 14th 2008)

A bug prevented scroll area from scrolling a list box correctly. It was caused by the fact that list box called Widget::showPart on every logic call to fix it's scroll when a user goes up and down the list which caused the scroll areas scroll to be ignored. The problem has been fixed by only calling Widget::showPart when a new item in the list box has been selected.
  • Loading branch information
Jarod42 committed Sep 4, 2024
commit d53962a65327f434bddf25154b8fba2acad1772d
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Continue rebasing from 6725f3b08248d94e3ac11ce530aec42e3029fc62
* Continue rebasing from 840e2ea3b13eb24057b8505eaa615d4e6bd363c6
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
27 changes: 13 additions & 14 deletions src/widgets/listbox.cpp
Original file line number Diff line number Diff line change
@@ -169,20 +169,6 @@ namespace gcn
void ListBox::logic()
{
adjustSize();

Rectangle scroll;

if (mSelected < 0)
{
scroll.y = 0;
}
else
{
scroll.y = getRowHeight() * mSelected;
}

scroll.height = getRowHeight();
showPart(scroll);
}

int ListBox::getSelected() const
@@ -211,6 +197,19 @@ namespace gcn
mSelected = selected;
}
}
Rectangle scroll;

if (mSelected < 0)
{
scroll.y = 0;
}
else
{
scroll.y = getRowHeight() * mSelected;
}

scroll.height = getRowHeight();
showPart(scroll);

distributeValueChangedEvent();
}