Use main window aspect ratio for narrow layout decision on cover browser position

This commit is contained in:
Kovid Goyal 2024-01-06 16:58:38 +05:30
parent b501bce746
commit 40f3e15a18
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -367,7 +367,10 @@ class CentralContainer(QWidget):
@property @property
def narrow_cb_on_top(self): 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 @property
def is_visible(self): def is_visible(self):