mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Edit Flight window is now dynamically sized.
This means that the waypoint names no longer get cut off. Contributes-to: Khopa/dcs_liberation#754
This commit is contained in:
parent
6f5bb6ffa2
commit
7269dbb79d
@ -20,7 +20,7 @@ class QEditFlightDialog(QDialog):
|
||||
|
||||
self.game_model = game_model
|
||||
|
||||
self.setWindowTitle("Create flight")
|
||||
self.setWindowTitle("Edit flight")
|
||||
self.setWindowIcon(EVENT_ICONS["strike"])
|
||||
|
||||
layout = QVBoxLayout()
|
||||
|
||||
@ -19,7 +19,6 @@ class QFlightWaypointList(QTableView):
|
||||
|
||||
self.model = QStandardItemModel(self)
|
||||
self.setModel(self.model)
|
||||
self.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
|
||||
self.model.setHorizontalHeaderLabels(["Name", "Alt", "TOT/DEPART"])
|
||||
|
||||
header = self.horizontalHeader()
|
||||
@ -41,6 +40,11 @@ class QFlightWaypointList(QTableView):
|
||||
self.add_waypoint_row(row, self.flight, waypoint)
|
||||
self.selectionModel().setCurrentIndex(self.indexAt(QPoint(1, 1)),
|
||||
QItemSelectionModel.Select)
|
||||
self.resizeColumnsToContents()
|
||||
total_column_width = self.verticalHeader().width() + self.lineWidth()
|
||||
for i in range(0, self.model.columnCount()):
|
||||
total_column_width += self.columnWidth(i) + self.lineWidth()
|
||||
self.setFixedWidth(total_column_width)
|
||||
|
||||
def add_waypoint_row(self, row: int, flight: Flight,
|
||||
waypoint: FlightWaypoint) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user