From bbcd3bce1ab529de35db2d7498000872664ed1ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 13 Jul 2022 08:19:25 +0530 Subject: [PATCH] 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. --- src/calibre/gui2/fts/search.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/fts/search.py b/src/calibre/gui2/fts/search.py index 550ac02bd9..6d30080d2c 100644 --- a/src/calibre/gui2/fts/search.py +++ b/src/calibre/gui2/fts/search.py @@ -3,7 +3,6 @@ # License: GPL v3 Copyright: 2022, Kovid Goyal -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))