forked from openlp/openlp
Make image preview respect slide-max-height setting
This commit is contained in:
parent
22fc6f746f
commit
0f91ad72fd
@ -213,11 +213,15 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
|
|||||||
layout.addWidget(label)
|
layout.addWidget(label)
|
||||||
container.setLayout(layout)
|
container.setLayout(layout)
|
||||||
slide_height = width // self.screen_ratio
|
slide_height = width // self.screen_ratio
|
||||||
max_slide_height = Settings().value('advanced/slide max height')
|
max_img_row_height = Settings().value('advanced/slide max height')
|
||||||
if slide_height < 0:
|
if isinstance(max_img_row_height, int):
|
||||||
slide_height = max_slide_height
|
if max_img_row_height > 0 and slide_height > max_img_row_height:
|
||||||
else:
|
slide_height = max_img_row_height
|
||||||
slide_height = min(slide_height, max_slide_height)
|
elif max_img_row_height < 0:
|
||||||
|
# If auto setting, show that number of slides, or if the resulting slides too small, 100px.
|
||||||
|
# E.g. If setting is -4, 4 slides will be visible, unless those slides are < 100px high.
|
||||||
|
self.auto_row_height = max(self.viewport().height() / (-1 * max_img_row_height), 100)
|
||||||
|
slide_height = min(slide_height, self.auto_row_height)
|
||||||
self.setCellWidget(slide_index, 0, container)
|
self.setCellWidget(slide_index, 0, container)
|
||||||
row += 1
|
row += 1
|
||||||
text.append(str(row))
|
text.append(str(row))
|
||||||
|
Loading…
Reference in New Issue
Block a user