From 9211f72cd3b1cde693b25e26c47f1492c3d5689b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Oct 2013 09:52:26 +0530 Subject: [PATCH] OSX: Fix font size in completion popups too small on Mavericks (I hope) Fixes #1243761 [In OS 10.9 pull-down menus are to small](https://bugs.launchpad.net/calibre/+bug/1243761) --- src/calibre/gui2/complete2.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 51e5ed4812..3214cb5fff 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -11,8 +11,9 @@ import weakref import sip from PyQt4.Qt import (QLineEdit, QAbstractListModel, Qt, pyqtSignal, QObject, - QApplication, QListView, QPoint, QModelIndex) + QApplication, QListView, QPoint, QModelIndex, QFont, QFontInfo) +from calibre.constants import isosx, get_osx_version from calibre.utils.icu import sort_key, primary_startswith from calibre.gui2 import NONE from calibre.gui2.widgets import EnComboBox, LineEditECM @@ -165,6 +166,14 @@ class Completer(QListView): # {{{ self.setCurrentIndex(self.model().index(0)) if not p.isVisible(): + if isosx and get_osx_version() >= (10, 9, 0): + # On mavericks the popup menu seems to use a font smaller than + # the widgets font, see for example: + # https://bugs.launchpad.net/bugs/1243761 + fp = QFontInfo(widget.font()) + f = QFont() + f.setPixelSize(fp.pixelSize()) + self.setFont(f) p.show() def eventFilter(self, obj, e):