Remove the UI::EventReturn return values. Makes editing the UI nicer.

This commit is contained in:
Henrik Rydgård committed 2025-09-15 11:09:00 -06:00
1 parent 730fd4754e
commit 58456ae950
62 files changed
+516 -935

No files matched your search

+3 -7
View File
@@ -552,14 +552,13 @@ std::string ListView::DescribeText() const {
return DescribeListOrdered(u->T("List:"));
}
EventReturn ListView::OnItemCallback(int num, EventParams &e) {
void ListView::OnItemCallback(int num, EventParams &e) {
EventParams ev{};
ev.v = nullptr;
ev.a = num;
adaptor_->SetSelected(num);
OnChoice.Trigger(ev);
CreateAllItems();
return EVENT_DONE;
}
View *ChoiceListAdaptor::CreateItemView(int index, ImageID *optionalImageID) {
@@ -570,13 +569,11 @@ View *ChoiceListAdaptor::CreateItemView(int index, ImageID *optionalImageID) {
return choice;
}
bool ChoiceListAdaptor::AddEventCallback(View *view, std::function<EventReturn(EventParams &)> callback) {
void ChoiceListAdaptor::AddEventCallback(View *view, std::function<void(EventParams &)> callback) {
Choice *choice = (Choice *)view;
choice->OnClick.Add(callback);
return EVENT_DONE;
}
View *StringVectorListAdaptor::CreateItemView(int index, ImageID *optionalImageID) {
Choice *choice = new Choice(items_[index], "", index == selected_);
if (optionalImageID) {
@@ -585,10 +582,9 @@ View *StringVectorListAdaptor::CreateItemView(int index, ImageID *optionalImageI
return choice;
}
bool StringVectorListAdaptor::AddEventCallback(View *view, std::function<EventReturn(EventParams &)> callback) {
void StringVectorListAdaptor::AddEventCallback(View *view, std::function<void(EventParams &)> callback) {
Choice *choice = (Choice *)view;
choice->OnClick.Add(callback);
return EVENT_DONE;
}
} // namespace