Add fallback for bug observed on debian 10.

This commit is contained in:
Faerbit 2020-02-26 18:38:56 +01:00
parent 8eba8ac60e
commit f38fed4f18

View File

@ -98,8 +98,13 @@ class Report(QtWidgets.QDialog):
self.tableWidget.setMinimumWidth(min_width * 1.33)
self.header.setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
if self.tableWidget.rowCount() > 4:
if hasattr(self.tableWidget, "screen"):
screen_height = self.tableWidget.screen().size().height()
else:
print("unable to detect screen height falling back to default value of 1080")
screen_height = 1080
self.tableWidget.setMinimumHeight(min((self.tableWidget.rowCount() + 2) * self.tableWidget.rowHeight(0),
self.tableWidget.screen().size().height() * 0.8))
screen_height * 0.8))
def update_prev_next(self):
prev, _next = self._report.prev_next_avail()