From 40f3e15a188e29bd5d34809800eba7851aa97a06 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 Jan 2024 16:58:38 +0530 Subject: [PATCH] Use main window aspect ratio for narrow layout decision on cover browser position --- src/calibre/gui2/central.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/central.py b/src/calibre/gui2/central.py index 75300b2900..1c75ccb892 100644 --- a/src/calibre/gui2/central.py +++ b/src/calibre/gui2/central.py @@ -367,7 +367,10 @@ class CentralContainer(QWidget): @property def narrow_cb_on_top(self): - return self.width() / self.height() <= 1.4 + from calibre.gui2.ui import get_gui + gui = get_gui() + ratio = self.width() / self.height() if gui is None else gui.width() / gui.height() + return ratio <= 1.4 @property def is_visible(self):