From 09a32f2ce1056df43eacce384827142390dfd916 Mon Sep 17 00:00:00 2001 From: PeterN Date: Wed, 11 Jan 2023 18:26:38 +0000 Subject: [PATCH] Fix #10335: Set initial scrollbar count for object GUI. (#10336) This previously happened when the window was resized by itself which was fixed by #10196. Explicitly set the count instead. --- src/object_gui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 31b7df2d25..cdbfdc70de 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -119,6 +119,7 @@ public: NWidgetMatrix *matrix = this->GetWidget(WID_BO_SELECT_MATRIX); matrix->SetScrollbar(this->GetScrollbar(WID_BO_SELECT_SCROLL)); + matrix->SetCount(ObjectClass::Get(_selected_object_class)->GetUISpecCount()); this->GetWidget(WID_BO_OBJECT_MATRIX)->SetCount(4);