Give aircraft purchase the majority of the window.

This makes long squadron names more likely to fit. I also added a
horizontal scroll bar for the cases when this still isn't enough space
and made the vertical scroll bar only appear when necessary. Typically
aircraft purchase menus are neither wide enough for long enough to need
either scroll bar.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1592
This commit is contained in:
Dan Albert 2021-10-17 13:22:36 -07:00
parent 702e29b54b
commit bbeb80fc48
2 changed files with 4 additions and 7 deletions

View File

@ -54,8 +54,6 @@ class QAircraftRecruitmentMenu(UnitTransactionFrame[Squadron]):
scroll_content.setLayout(task_box_layout)
scroll = QScrollArea()
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setWidgetResizable(True)
scroll.setWidget(scroll_content)
main_layout.addLayout(self.hangar_status)

View File

@ -1,4 +1,4 @@
from PySide2.QtWidgets import QFrame, QGridLayout, QGroupBox, QVBoxLayout
from PySide2.QtWidgets import QFrame, QGroupBox, QHBoxLayout, QVBoxLayout
from game.theater import ControlPoint
from qt_ui.models import GameModel
@ -16,14 +16,13 @@ class QAirfieldCommand(QFrame):
self.init_ui()
def init_ui(self):
layout = QGridLayout()
layout.setHorizontalSpacing(1)
layout.addWidget(QAircraftRecruitmentMenu(self.cp, self.game_model), 0, 0)
layout = QHBoxLayout()
layout.addWidget(QAircraftRecruitmentMenu(self.cp, self.game_model), stretch=5)
planned = QGroupBox("Planned Flights")
planned_layout = QVBoxLayout()
planned_layout.addWidget(QPlannedFlightsView(self.game_model, self.cp))
planned.setLayout(planned_layout)
layout.addWidget(planned, 0, 1)
layout.addWidget(planned, stretch=3)
self.setLayout(layout)