mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Options to control the size and placement of the emblems
This commit is contained in:
parent
4f8f624d07
commit
979eb5c86c
@ -338,9 +338,11 @@ class CoverDelegate(QStyledItemDelegate):
|
||||
height = self.original_height = gprefs['cover_grid_height']
|
||||
self.original_show_title = show_title = gprefs['cover_grid_show_title']
|
||||
self.original_show_emblems = gprefs['show_emblems']
|
||||
self.orginal_emblem_size = gprefs['emblem_size']
|
||||
self.orginal_emblem_position = gprefs['emblem_position']
|
||||
self.emblem_size = gprefs['emblem_size'] if self.original_show_emblems else 0
|
||||
try:
|
||||
self.gutter_position = getattr(self, gprefs['emblem_position'].upper())
|
||||
self.gutter_position = getattr(self, self.orginal_emblem_position.upper())
|
||||
except Exception:
|
||||
self.gutter_position = self.TOP
|
||||
|
||||
@ -705,7 +707,9 @@ class GridView(QListView):
|
||||
gprefs['cover_grid_height'] != self.delegate.original_height
|
||||
)
|
||||
if (size_changed or gprefs['cover_grid_show_title'] != self.delegate.original_show_title or
|
||||
gprefs['show_emblems'] != self.delegate.original_show_emblems):
|
||||
gprefs['show_emblems'] != self.delegate.original_show_emblems or
|
||||
gprefs['emblem_size'] != self.delegate.orginal_emblem_size or
|
||||
gprefs['emblem_position'] != self.delegate.orginal_emblem_position):
|
||||
self.delegate.set_dimensions()
|
||||
self.setSpacing(self.delegate.spacing)
|
||||
if size_changed:
|
||||
|
@ -155,6 +155,9 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
r('cover_browser_reflections', gprefs)
|
||||
r('show_rating_in_cover_browser', gprefs)
|
||||
r('extra_row_spacing', gprefs)
|
||||
r('emblem_size', gprefs)
|
||||
r('emblem_position', gprefs, choices=[
|
||||
(_('Left'), 'left'), (_('Top'), 'top'), (_('Right'), 'right'), (_('Bottom'), 'bottom')])
|
||||
|
||||
def get_esc_lang(l):
|
||||
if l == 'en':
|
||||
|
@ -244,8 +244,8 @@
|
||||
<attribute name="title">
|
||||
<string>Main</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Control the cover grid view. You can enable this view by clicking the grid button in the bottom right corner of the main calibre window.</string>
|
||||
@ -255,7 +255,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -271,16 +271,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="opt_cover_grid_show_title">
|
||||
<property name="text">
|
||||
<string>Show a field (such as title) &under the covers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>&Field to show under the covers:</string>
|
||||
@ -290,27 +281,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="opt_field_under_covers_in_grid"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>&Spacing between covers:</string>
|
||||
@ -320,7 +294,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QDoubleSpinBox" name="opt_cover_grid_spacing">
|
||||
<property name="toolTip">
|
||||
<string>The spacing between covers. A value of zero means calculate automatically based on cover size.</string>
|
||||
@ -339,22 +313,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="cg_background_box">
|
||||
<property name="title">
|
||||
<string>Background for the cover grid</string>
|
||||
@ -362,12 +321,22 @@
|
||||
<layout class="QGridLayout" name="gridLayout_5"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
<property name="title">
|
||||
<string>Cover size</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" colspan="5">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>By default, calibre chooses a cover size based on your computer's screen size. You can change the cover size here:</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="5">
|
||||
<widget class="QLabel" name="cover_grid_aspect_ratio">
|
||||
<property name="text">
|
||||
@ -457,6 +426,16 @@ A value of zero means calculate automatically.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" rowspan="2">
|
||||
<widget class="QPushButton" name="cover_grid_reset_size">
|
||||
<property name="toolTip">
|
||||
<string>Reset size to automatic</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reset size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
@ -470,41 +449,51 @@ A value of zero means calculate automatically.</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>By default, calibre chooses a cover size based on your computer's screen size. You can change the cover size here:</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" rowspan="2">
|
||||
<widget class="QPushButton" name="cover_grid_reset_size">
|
||||
<property name="toolTip">
|
||||
<string>Reset size to automatic</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reset size</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item row="11" column="1">
|
||||
<widget class="QSpinBox" name="opt_emblem_size">
|
||||
<property name="suffix">
|
||||
<string> px</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>170</height>
|
||||
</size>
|
||||
<property name="minimum">
|
||||
<number>16</number>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_21">
|
||||
<property name="text">
|
||||
<string>&Size of the emblems (if any) shown next to the covers: </string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>opt_emblem_size</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="opt_cover_grid_show_title">
|
||||
<property name="text">
|
||||
<string>Show a field (such as title) &under the covers</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>&Location of the emblems shown next to the covers:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>opt_emblem_position</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QComboBox" name="opt_emblem_position"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user