Make new flight comboboxes auto-adjust their size.

Content was previously being cut off when the first airport selected had a shorter name than the one the player wanted.
This commit is contained in:
Simon Clark 2021-01-08 22:52:21 +00:00
parent 64b2eeface
commit 7ae934e940
2 changed files with 2 additions and 0 deletions

View File

@ -15,3 +15,4 @@ class QAircraftTypeSelector(QComboBox):
for aircraft in aircraft_types:
self.addItem(f"{db.unit_pretty_name(country, aircraft)}", userData=aircraft)
self.model().sort(0)
self.setSizeAdjustPolicy(self.AdjustToContents)

View File

@ -27,6 +27,7 @@ class QOriginAirfieldSelector(QComboBox):
self.aircraft = aircraft
self.rebuild_selector()
self.currentIndexChanged.connect(self.index_changed)
self.setSizeAdjustPolicy(self.AdjustToContents)
def change_aircraft(self, aircraft: FlyingType) -> None:
if self.aircraft == aircraft: