forked from openlp/openlp
Housekeeping, added check for thumbnails to avoid icon scaling issues
This commit is contained in:
parent
a2bc59b3d9
commit
bc6253a627
@ -56,12 +56,12 @@ class ImageSource(object):
|
||||
``Theme``
|
||||
This says, that the image is used by a theme.
|
||||
|
||||
``PresentationPlugin``
|
||||
This states that an image is being used by the presentation plugin.
|
||||
``CommandPlugins``
|
||||
This states that an image is being used by a command plugin.
|
||||
"""
|
||||
ImagePlugin = 1
|
||||
Theme = 2
|
||||
PresentationPlugin = 3
|
||||
CommandPlugins = 3
|
||||
|
||||
|
||||
class MediaType(object):
|
||||
|
@ -334,7 +334,8 @@ class ServiceItem(RegistryProperties):
|
||||
file_location_hash, ntpath.basename(image))
|
||||
self._raw_frames.append({'title': file_name, 'image': image, 'path': path,
|
||||
'display_title': display_title, 'notes': notes})
|
||||
self.image_manager.add_image(image, ImageSource.PresentationPlugin, '#000000')
|
||||
if self.is_capable(ItemCapabilities.HasThumbnails):
|
||||
self.image_manager.add_image(image, ImageSource.CommandPlugins, '#000000')
|
||||
self._new_item()
|
||||
|
||||
def get_service_repr(self, lite_save):
|
||||
|
@ -27,7 +27,7 @@ It is based on a QTableWidget but represents its contents in list form.
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from openlp.core.common import RegistryProperties, Settings
|
||||
from openlp.core.lib import ImageSource, ServiceItem
|
||||
from openlp.core.lib import ImageSource, ItemCapabilities, ServiceItem
|
||||
|
||||
|
||||
class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
|
||||
@ -152,10 +152,14 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
|
||||
else:
|
||||
label.setScaledContents(True)
|
||||
if self.service_item.is_command():
|
||||
image = self.image_manager.get_image(frame['image'], ImageSource.PresentationPlugin)
|
||||
if self.service_item.is_capable(ItemCapabilities.HasThumbnails):
|
||||
image = self.image_manager.get_image(frame['image'], ImageSource.CommandPlugins)
|
||||
pixmap = QtGui.QPixmap.fromImage(image)
|
||||
else:
|
||||
pixmap = QtGui.QPixmap(frame['image'])
|
||||
else:
|
||||
image = self.image_manager.get_image(frame['path'], ImageSource.ImagePlugin)
|
||||
pixmap = QtGui.QPixmap.fromImage(image)
|
||||
pixmap = QtGui.QPixmap.fromImage(image)
|
||||
pixmap.setDevicePixelRatio(label.devicePixelRatio())
|
||||
label.setPixmap(pixmap)
|
||||
slide_height = width // self.screen_ratio
|
||||
|
@ -1141,8 +1141,13 @@ class SlideController(DisplayController, RegistryProperties):
|
||||
# but take another in a couple of seconds in case slide change is slow
|
||||
QtCore.QTimer.singleShot(2500, self.grab_maindisplay)
|
||||
else:
|
||||
# If not live, use the slide's thumbnail instead
|
||||
self.slide_image = QtGui.QPixmap.fromImage(self.image_manager.get_image(self.service_item.get_rendered_frame(self.selected_row), ImageSource.PresentationPlugin)) #QtGui.QPixmap(self.service_item.get_rendered_frame(self.selected_row))
|
||||
# If not live, use the slide's thumbnail/icon instead
|
||||
image_path = self.service_item.get_rendered_frame(self.selected_row)
|
||||
if self.service_item.is_capable(ItemCapabilities.HasThumbnails):
|
||||
image = self.image_manager.get_image(image_path, ImageSource.CommandPlugins)
|
||||
self.slide_image = QtGui.QPixmap.fromImage(image)
|
||||
else:
|
||||
self.slide_image = QtGui.QPixmap(image_path)
|
||||
self.slide_image.setDevicePixelRatio(self.main_window.devicePixelRatio())
|
||||
self.slide_preview.setPixmap(self.slide_image)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user