Button to reset cover sizes to automatic

This commit is contained in:
Kovid Goyal 2013-08-14 10:15:22 +05:30
parent 9e0b25ec5f
commit 1d796e5817
2 changed files with 20 additions and 5 deletions

View File

@ -220,6 +220,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.cover_grid_open_cache.clicked.connect(self.open_cg_cache)
self.cover_grid_smaller_cover.clicked.connect(partial(self.resize_cover, True))
self.cover_grid_larger_cover.clicked.connect(partial(self.resize_cover, False))
self.cover_grid_reset_size.clicked.connect(self.cg_reset_size)
self.opt_cover_grid_disk_cache_size.setMinimum(self.gui.grid_view.thumbnail_cache.min_disk_cache)
self.opt_cover_grid_disk_cache_size.setMaximum(self.gui.grid_view.thumbnail_cache.min_disk_cache * 100)
self.opt_cover_grid_width.valueChanged.connect(self.update_aspect_ratio)
@ -250,6 +251,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.opt_cover_grid_height.setValue(cval)
self.opt_cover_grid_width.setValue(cval * ar)
def cg_reset_size(self):
self.opt_cover_grid_width.setValue(0)
self.opt_cover_grid_height.setValue(0)
def initialize(self):
ConfigWidgetBase.initialize(self)
font = gprefs['font']

View File

@ -367,6 +367,13 @@
<string>Cover size</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="0" colspan="5">
<widget class="QLabel" name="cover_grid_aspect_ratio">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
@ -449,7 +456,7 @@ A value of zero means calculate automatically.</string>
</property>
</widget>
</item>
<item row="1" column="3">
<item row="1" column="4">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -462,7 +469,7 @@ A value of zero means calculate automatically.</string>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="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>
@ -472,10 +479,13 @@ A value of zero means calculate automatically.</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="QLabel" name="cover_grid_aspect_ratio">
<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/>
<string>&amp;Reset size</string>
</property>
</widget>
</item>