Fix #948357 (Increased font size in book details)

This commit is contained in:
Kovid Goyal 2012-03-07 16:19:27 +05:30
commit d4cf454f1b
4 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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'

View File

@ -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'

View File

@ -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'