diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index ee2e07f412..a15cb62aaf 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -496,3 +496,9 @@ gui_view_history_size = 15 # prefer HTMLZ to EPUB for tweaking, change this to 'htmlz' tweak_book_prefer = 'epub' +#: Change the font size of book details in the interface +# Change the font size at which book details are rendered in the side panel and +# comments are rendered in the metadata edit dialog. Set it to a positive or +# negative number to increase or decrease the font size. +change_book_details_font_size_by = 0 + diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 08df7007a2..4b12335fe3 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -25,6 +25,7 @@ from calibre.utils.icu import sort_key from calibre.utils.formatter import EvalFormatter from calibre.utils.date import is_date_undefined from calibre.utils.localization import calibre_langcode_to_name +from calibre.utils.config import tweaks def render_html(mi, css, vertical, widget, all_fields=False): # {{{ table = render_data(mi, all_fields=all_fields, @@ -39,7 +40,7 @@ def render_html(mi, css, vertical, widget, all_fields=False): # {{{ return ans fi = QFontInfo(QApplication.font(widget)) - f = fi.pixelSize()+1 + f = fi.pixelSize() + 1 + int(tweaks['change_book_details_font_size_by']) fam = unicode(fi.family()).strip().replace('"', '') if not fam: fam = 'sans-serif' diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index e58b7117c1..1324a3cbd4 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -19,6 +19,7 @@ from calibre.ebooks.chardet import xml_to_unicode from calibre import xml_replace_entities from calibre.gui2 import open_url from calibre.utils.soupparser import fromstring +from calibre.utils.config import tweaks class PageAction(QAction): # {{{ @@ -252,7 +253,7 @@ class EditorWidget(QWebView): # {{{ def fset(self, val): self.setHtml(val) fi = QFontInfo(QApplication.font(self)) - f = fi.pixelSize()+1 + f = fi.pixelSize() + 1 + int(tweaks['change_book_details_font_size_by']) fam = unicode(fi.family()).strip().replace('"', '') if not fam: fam = 'sans-serif' diff --git a/src/calibre/gui2/metadata/single_download.py b/src/calibre/gui2/metadata/single_download.py index 6149c3be8a..095b57af60 100644 --- a/src/calibre/gui2/metadata/single_download.py +++ b/src/calibre/gui2/metadata/single_download.py @@ -32,6 +32,8 @@ from calibre.utils.date import (utcnow, fromordinal, format_date, UNDEFINED_DATE, as_utc) from calibre.library.comments import comments_to_html from calibre import force_unicode +from calibre.utils.config import tweaks + # }}} class RichTextDelegate(QStyledItemDelegate): # {{{ @@ -326,7 +328,7 @@ class Comments(QWebView): # {{{ return ans fi = QFontInfo(QApplication.font(self.parent())) - f = fi.pixelSize()+1 + f = fi.pixelSize()+1+int(tweaks['change_book_details_font_size_by']) fam = unicode(fi.family()).strip().replace('"', '') if not fam: fam = 'sans-serif'