diff --git a/report.py b/report.py index 975552f..740f509 100644 --- a/report.py +++ b/report.py @@ -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()