mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 02:43:34 +02:00
Fix comments not being displayed to the side in the horizontal book display panel
Thanks to limitations of Qt's HTML support we cant any longer have comments text wrap around the rest of the metadata. Now the rest of the metadata and the comments are display in 2:3 fixed columns
This commit is contained in:
parent
6bb5a1376c
commit
85394a43a8
3 changed files with 13 additions and 35 deletions
|
|
@ -131,6 +131,7 @@ def color_to_string(col):
|
|||
</style>
|
||||
<style type="text/css">
|
||||
%s
|
||||
table td.title { white-space: nowrap }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -141,17 +142,13 @@ def color_to_string(col):
|
|||
comments = ''
|
||||
if comment_fields:
|
||||
comments = '\n'.join('<div>%s</div>' % x for x in comment_fields)
|
||||
right_pane = '<div id="comments" class="comments">%s</div>'%comments
|
||||
right_pane = comments
|
||||
|
||||
if vertical:
|
||||
ans = templ%(table+right_pane)
|
||||
else:
|
||||
if gprefs['book_details_narrow_comments_layout'] == 'columns':
|
||||
ans = templ%('<table><tr><td valign="top" '
|
||||
'style="padding-right:2em; width:40%%">%s</td><td valign="top">%s</td></tr></table>'
|
||||
% (table, right_pane))
|
||||
else:
|
||||
ans = templ%('<div style="float: left; margin-right: 1em; margin-bottom: 1em; max-width: 40%">{}</div><div>{}</div>'.format(
|
||||
ans = templ % (
|
||||
'<table><tr><td valign="top" width="40%">{}</td><td valign="top" width="60%">{}</td></tr></table>'.format(
|
||||
table, right_pane))
|
||||
return ans
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import json, textwrap
|
||||
import json
|
||||
|
||||
from collections import defaultdict
|
||||
from threading import Thread
|
||||
|
|
@ -440,12 +440,6 @@ def genesis(self, gui):
|
|||
(_('Left'), 'left'), (_('Top'), 'top'), (_('Right'), 'right'), (_('Bottom'), 'bottom')])
|
||||
r('book_list_extra_row_spacing', gprefs)
|
||||
r('booklist_grid', gprefs)
|
||||
r('book_details_narrow_comments_layout', gprefs, choices=[(_('Float'), 'float'), (_('Columns'), 'columns')])
|
||||
self.opt_book_details_narrow_comments_layout.setToolTip(textwrap.fill(_(
|
||||
'Choose how the text is laid out when using the "Narrow" user interface layout.'
|
||||
' A value of "Float" means that the comments text will wrap around'
|
||||
' the other metadata fields, while a value of "Columns" means that'
|
||||
' the comments will be in a separate fixed width column.')))
|
||||
self.cover_browser_title_template_button.clicked.connect(self.edit_cb_title_template)
|
||||
self.id_links_button.clicked.connect(self.edit_id_link_rules)
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>843</width>
|
||||
<height>552</height>
|
||||
<height>580</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -727,17 +727,7 @@ A value of zero means calculate automatically.</string>
|
|||
<string>&Book details</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Note that <b>comments</b> will always be displayed at the end, regardless of the position you assign here.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" rowspan="2">
|
||||
<item row="3" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Select displayed metadata</string>
|
||||
|
|
@ -832,7 +822,7 @@ A value of zero means calculate automatically.</string>
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="id_links_button">
|
||||
<property name="text">
|
||||
<string>Create rules to convert &identifiers into links</string>
|
||||
|
|
@ -849,19 +839,16 @@ A value of zero means calculate automatically.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_25">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>How to display text in the 'Narrow' &layout:</string>
|
||||
<string>Note that <b>comments</b> will always be displayed at the end, regardless of the position you assign here.</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>opt_book_details_narrow_comments_layout</cstring>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="opt_book_details_narrow_comments_layout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tag_browser_tab">
|
||||
|
|
|
|||
Loading…
Reference in a new issue