Add an option under Preferences->Look & Feel->Book Details to hide the cover in the book details panel

This commit is contained in:
Kovid Goyal 2012-09-01 09:48:20 +05:30
parent f4ade0dc3b
commit c8b8825b18
4 changed files with 38 additions and 25 deletions

View File

@ -101,6 +101,7 @@ gprefs.defaults['auto_add_auto_convert'] = True
gprefs.defaults['ui_style'] = 'calibre' if iswindows or isosx else 'system'
gprefs.defaults['tag_browser_old_look'] = False
gprefs.defaults['book_list_tooltips'] = True
gprefs.defaults['bd_show_cover'] = True
# }}}
NONE = QVariant() #: Null value to return from the data function of item models

View File

@ -297,7 +297,8 @@ class CoverView(QWidget): # {{{
self.pixmap = self.default_pixmap
self.do_layout()
self.update()
if not same_item and not config['disable_animations']:
if (not same_item and not config['disable_animations'] and
self.isVisible()):
self.animation.start()
def paintEvent(self, event):
@ -512,6 +513,7 @@ class DetailsLayout(QLayout): # {{{
self.do_layout(r)
def cover_height(self, r):
if not self._children[0].widget().isVisible(): return 0
mh = min(int(r.height()/2.), int(4/3. * r.width())+1)
try:
ph = self._children[0].widget().pixmap.height()
@ -522,6 +524,7 @@ class DetailsLayout(QLayout): # {{{
return mh
def cover_width(self, r):
if not self._children[0].widget().isVisible(): return 0
mw = 1 + int(3/4. * r.height())
try:
pw = self._children[0].widget().pixmap.width()
@ -660,6 +663,7 @@ class BookDetails(QWidget): # {{{
self.update_layout()
def update_layout(self):
self.cover_view.setVisible(gprefs['bd_show_cover'])
self._layout.do_layout(self.rect())
self.cover_view.update_tooltip(self.current_path)

View File

@ -106,6 +106,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
'calibre')])
r('book_list_tooltips', gprefs)
r('tag_browser_old_look', gprefs, restart_required=True)
r('bd_show_cover', gprefs)
r('cover_flow_queue_length', config, restart_required=True)

View File

@ -212,19 +212,32 @@
<string>Book Details</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_12">
<item row="1" column="0" rowspan="2">
<item row="2" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Note that &lt;b&gt;comments&lt;/b&gt; 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="0" column="1">
<widget class="QCheckBox" name="opt_use_roman_numerals_for_series_number">
<property name="text">
<string>Use &amp;Roman numerals for series</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" rowspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Select displayed metadata</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" rowspan="3">
<widget class="QListView" name="field_display_order">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="df_up_button">
<property name="toolTip">
@ -247,6 +260,13 @@
</property>
</widget>
</item>
<item row="0" column="0" rowspan="3">
<widget class="QListView" name="field_display_order">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer_5">
<property name="orientation">
@ -288,23 +308,10 @@ Manage Authors. You can use the values {author} and
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="opt_use_roman_numerals_for_series_number">
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="opt_bd_show_cover">
<property name="text">
<string>Use &amp;Roman numerals for series</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Note that &lt;b&gt;comments&lt;/b&gt; will always be displayed at the end, regardless of the position you assign here.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<string>Show &amp;cover in the book details panel</string>
</property>
</widget>
</item>