Fix #1895287 [[Enhancement] Covers that do not fill the area are displayed at the bottom of the content server's cover grid](https://bugs.launchpad.net/calibre/+bug/1895287)

This commit is contained in:
Kovid Goyal 2020-09-11 19:58:21 +05:30
parent fc980d13a4
commit 40e91596fb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -14,9 +14,11 @@ THUMBNAIL_MIN_WIDTH = 3 * 35
THUMBNAIL_MIN_HEIGHT = 4 * 35
BORDER_RADIUS = 10
def description():
return _('A grid of book covers')
def cover_grid_css():
sel = '.' + COVER_GRID_CLASS
margin, margin_unit = 10, 'px'
@ -26,7 +28,7 @@ def cover_grid_css():
# Container for an individual cover
sel += ' > a'
ans += build_rule(
sel, margin=f'{margin}{margin_unit}', display='flex', align_content='flex-end', align_items='flex-end', justify_content='space-around',
sel, margin=f'{margin}{margin_unit}', display='flex', align_content='flex-end', align_items='center', justify_content='space-around',
max_width=THUMBNAIL_MAX_WIDTH+'px', max_height=THUMBNAIL_MAX_HEIGHT+'px', cursor='pointer',
min_width=THUMBNAIL_MIN_WIDTH+'px', min_height=THUMBNAIL_MIN_HEIGHT + 'px')
mq = '@media all and (orientation: {orient}) {{ {sel} {{ width: 21{dim}; height: 28{dim} }} }}\n'