Simplify sizing of book info text

It was previously sized to have a height no more than the cover label's
height. Instead just size it to be the same height. This fixes sub
optimal layout when there is less available width.
This commit is contained in:
Kovid Goyal 2022-07-13 08:19:25 +05:30
parent cd91088c98
commit bbcd3bce1a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -3,7 +3,6 @@
# License: GPL v3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
import math
import os
import re
import time
@ -572,11 +571,8 @@ class ResultDetails(QWidget):
d = self.book_info.document()
d.setDocumentMargin(0)
d.setTextWidth(float(w))
h = min(int(math.ceil(d.size().height())), self.pixmap_label.height())
self.book_info.setGeometry(QRect(self.pixmap_label.geometry().right() + 8, 0, w, h))
if self.book_info.horizontalScrollBar().isVisible():
h += self.book_info.horizontalScrollBar().height() + 1
self.book_info.setGeometry(QRect(self.pixmap_label.geometry().right() + 8, 0, w, h))
ph = self.pixmap_label.height()
self.book_info.setGeometry(QRect(self.pixmap_label.geometry().right() + 8, 0, w, ph))
top = max(self.book_info.geometry().bottom(), self.pixmap_label.geometry().bottom())
self.results.setGeometry(QRect(0, top, g.width(), g.height() - top))