From 48fb94e5f7e12a1d3d280dc86ad9e70213c9ae47 Mon Sep 17 00:00:00 2001 From: JustForFun Date: Mon, 5 Mar 2012 23:18:47 +0100 Subject: [PATCH] added tweak for font size increase/decrease in book details panel and book comments --- resources/default_tweaks.py | 7 +++++++ src/calibre/gui2/book_details.py | 3 ++- src/calibre/gui2/comments_editor.py | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index ee2e07f412..a71895e214 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -496,3 +496,10 @@ gui_view_history_size = 15 # prefer HTMLZ to EPUB for tweaking, change this to 'htmlz' tweak_book_prefer = 'epub' +#: Increase or decrease the font size in book details and book comments +# Controls the increase or decrease of the font size in the book details panel and the book +# comments. The font size will be increased by the specified numbers of pixels, a negative +# number will decrease the font size. +# The default value since version 0.8.39 is 1. For the old behavior set this to 0. +change_book_details_font_size_by = 1 + diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 08df7007a2..bd91ec76db 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() + 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..236a27899b 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() + tweaks['change_book_details_font_size_by'] fam = unicode(fi.family()).strip().replace('"', '') if not fam: fam = 'sans-serif'