mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-13 00:12:12 +01:00
Fix 98700eee43, Fix #14815: Properly handle picker window invalidation. (#14816)
This commit is contained in:
committed by
GitHub
parent
3555f26ae6
commit
26a84fad55
@@ -468,7 +468,7 @@ void PickerWindow::OnDropdownSelect(WidgetID widget, int index, int click_result
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We need to refresh if a filter is removed. */
|
/* We need to refresh if a filter is removed. */
|
||||||
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter});
|
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter, PickerInvalidation::Position});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ void PickerWindow::OnDropdownSelect(WidgetID widget, int index, int click_result
|
|||||||
} else {
|
} else {
|
||||||
SetBadgeFilter(this->badge_filter_choices, BadgeID(index));
|
SetBadgeFilter(this->badge_filter_choices, BadgeID(index));
|
||||||
}
|
}
|
||||||
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter});
|
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter, PickerInvalidation::Position});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -555,7 +555,7 @@ void PickerWindow::OnEditboxChanged(WidgetID wid)
|
|||||||
} else {
|
} else {
|
||||||
this->type_string_filter.btf.reset();
|
this->type_string_filter.btf.reset();
|
||||||
}
|
}
|
||||||
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter});
|
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Filter, PickerInvalidation::Position});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -693,7 +693,6 @@ void PickerWindow::BuildPickerTypeList()
|
|||||||
|
|
||||||
if (!this->has_type_picker) return;
|
if (!this->has_type_picker) return;
|
||||||
this->GetWidget<NWidgetMatrix>(WID_PW_TYPE_MATRIX)->SetCount(static_cast<int>(this->types.size()));
|
this->GetWidget<NWidgetMatrix>(WID_PW_TYPE_MATRIX)->SetCount(static_cast<int>(this->types.size()));
|
||||||
this->EnsureSelectedTypeIsVisible();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickerWindow::EnsureSelectedTypeIsValid()
|
void PickerWindow::EnsureSelectedTypeIsValid()
|
||||||
|
|||||||
Reference in New Issue
Block a user