added tweak for font size increase/decrease in book details panel and book comments

This commit is contained in:
JustForFun 2012-03-05 23:18:47 +01:00
parent cc0053b42f
commit 48fb94e5f7
3 changed files with 11 additions and 2 deletions

View File

@ -496,3 +496,10 @@ gui_view_history_size = 15
# prefer HTMLZ to EPUB for tweaking, change this to 'htmlz' # prefer HTMLZ to EPUB for tweaking, change this to 'htmlz'
tweak_book_prefer = 'epub' 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

View File

@ -25,6 +25,7 @@ from calibre.utils.icu import sort_key
from calibre.utils.formatter import EvalFormatter from calibre.utils.formatter import EvalFormatter
from calibre.utils.date import is_date_undefined from calibre.utils.date import is_date_undefined
from calibre.utils.localization import calibre_langcode_to_name 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): # {{{ def render_html(mi, css, vertical, widget, all_fields=False): # {{{
table = render_data(mi, all_fields=all_fields, table = render_data(mi, all_fields=all_fields,
@ -39,7 +40,7 @@ def render_html(mi, css, vertical, widget, all_fields=False): # {{{
return ans return ans
fi = QFontInfo(QApplication.font(widget)) 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('"', '') fam = unicode(fi.family()).strip().replace('"', '')
if not fam: if not fam:
fam = 'sans-serif' fam = 'sans-serif'

View File

@ -19,6 +19,7 @@ from calibre.ebooks.chardet import xml_to_unicode
from calibre import xml_replace_entities from calibre import xml_replace_entities
from calibre.gui2 import open_url from calibre.gui2 import open_url
from calibre.utils.soupparser import fromstring from calibre.utils.soupparser import fromstring
from calibre.utils.config import tweaks
class PageAction(QAction): # {{{ class PageAction(QAction): # {{{
@ -252,7 +253,7 @@ class EditorWidget(QWebView): # {{{
def fset(self, val): def fset(self, val):
self.setHtml(val) self.setHtml(val)
fi = QFontInfo(QApplication.font(self)) 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('"', '') fam = unicode(fi.family()).strip().replace('"', '')
if not fam: if not fam:
fam = 'sans-serif' fam = 'sans-serif'