mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Add an option to add extra spacing between rows in the book list. Fixes #1117907 ([Enhancement] Ability to change row height)
This commit is contained in:
parent
8e42bd34fc
commit
fc055d626e
@ -109,6 +109,7 @@ defs['bd_show_cover'] = True
|
|||||||
defs['bd_overlay_cover_size'] = False
|
defs['bd_overlay_cover_size'] = False
|
||||||
defs['tags_browser_category_icons'] = {}
|
defs['tags_browser_category_icons'] = {}
|
||||||
defs['cover_browser_reflections'] = True
|
defs['cover_browser_reflections'] = True
|
||||||
|
defs['extra_row_spacing'] = 0
|
||||||
del defs
|
del defs
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
@ -528,11 +528,16 @@ class BooksView(QTableView): # {{{
|
|||||||
|
|
||||||
self.was_restored = True
|
self.was_restored = True
|
||||||
|
|
||||||
|
def refresh_row_sizing(self):
|
||||||
|
self.row_sizing_done = False
|
||||||
|
self.do_row_sizing()
|
||||||
|
|
||||||
def do_row_sizing(self):
|
def do_row_sizing(self):
|
||||||
# Resize all rows to have the correct height
|
# Resize all rows to have the correct height
|
||||||
if not self.row_sizing_done and self.model().rowCount(QModelIndex()) > 0:
|
if not self.row_sizing_done and self.model().rowCount(QModelIndex()) > 0:
|
||||||
self.resizeRowToContents(0)
|
self.resizeRowToContents(0)
|
||||||
self.verticalHeader().setDefaultSectionSize(self.rowHeight(0))
|
self.verticalHeader().setDefaultSectionSize(self.rowHeight(0) +
|
||||||
|
gprefs['extra_row_spacing'])
|
||||||
self.row_sizing_done = True
|
self.row_sizing_done = True
|
||||||
|
|
||||||
def resize_column_to_fit(self, column):
|
def resize_column_to_fit(self, column):
|
||||||
|
@ -111,6 +111,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
|
|
||||||
r('cover_flow_queue_length', config, restart_required=True)
|
r('cover_flow_queue_length', config, restart_required=True)
|
||||||
r('cover_browser_reflections', gprefs)
|
r('cover_browser_reflections', gprefs)
|
||||||
|
r('extra_row_spacing', gprefs)
|
||||||
|
|
||||||
def get_esc_lang(l):
|
def get_esc_lang(l):
|
||||||
if l == 'en':
|
if l == 'en':
|
||||||
@ -292,6 +293,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
gui.library_view.refresh_book_details()
|
gui.library_view.refresh_book_details()
|
||||||
if hasattr(gui.cover_flow, 'setShowReflections'):
|
if hasattr(gui.cover_flow, 'setShowReflections'):
|
||||||
gui.cover_flow.setShowReflections(gprefs['cover_browser_reflections'])
|
gui.cover_flow.setShowReflections(gprefs['cover_browser_reflections'])
|
||||||
|
gui.library_view.refresh_row_sizing()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
|
@ -28,16 +28,6 @@
|
|||||||
<string>Main Interface</string>
|
<string>Main Interface</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_9">
|
<layout class="QGridLayout" name="gridLayout_9">
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="text">
|
|
||||||
<string>Choose &language (requires restart):</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_language</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QComboBox" name="opt_language">
|
<widget class="QComboBox" name="opt_language">
|
||||||
<property name="sizeAdjustPolicy">
|
<property name="sizeAdjustPolicy">
|
||||||
@ -55,6 +45,19 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_17">
|
<widget class="QLabel" name="label_17">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -105,54 +108,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" colspan="2">
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
|
||||||
<property name="title">
|
|
||||||
<string>&Toolbar</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_8">
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="opt_toolbar_icon_size"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>&Icon size:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_toolbar_icon_size</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="opt_toolbar_text"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_8">
|
|
||||||
<property name="text">
|
|
||||||
<string>Show &text under icons:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_toolbar_text</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
@ -191,6 +146,51 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="7" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>&Toolbar</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_8">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="opt_toolbar_icon_size"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Icon size:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_toolbar_icon_size</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="opt_toolbar_text"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_8">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show &text under icons:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_toolbar_text</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Choose &language (requires restart):</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_language</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="opt_ui_style"/>
|
<widget class="QComboBox" name="opt_ui_style"/>
|
||||||
</item>
|
</item>
|
||||||
@ -201,6 +201,26 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Extra &spacing to add between rows in the book list:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_extra_row_spacing</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QSpinBox" name="opt_extra_row_spacing">
|
||||||
|
<property name="specialValueText">
|
||||||
|
<string>None</string>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string> px</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_4">
|
<widget class="QWidget" name="tab_4">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user