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
Show file tree
Hide file tree
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
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.
Expand Down
27 changes: 13 additions & 14 deletions src/widgets/listbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand Down