forked from openlp/openlp
Fixed a bug with transparent backgrounds.
bzr-revno: 758
This commit is contained in:
commit
f6e6357176
@ -144,8 +144,9 @@ def resize_image(image, width, height):
|
|||||||
The image to resize.
|
The image to resize.
|
||||||
"""
|
"""
|
||||||
preview = QtGui.QImage(image)
|
preview = QtGui.QImage(image)
|
||||||
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
||||||
|
QtCore.Qt.SmoothTransformation)
|
||||||
realw = preview.width()
|
realw = preview.width()
|
||||||
realh = preview.height()
|
realh = preview.height()
|
||||||
# and move it to the centre of the preview space
|
# and move it to the centre of the preview space
|
||||||
|
@ -159,9 +159,10 @@ class ThemesTab(SettingsTab):
|
|||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
self.DefaultListView.setPixmap(display)
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
self.DefaultListView.setPixmap(preview)
|
||||||
|
|
||||||
def updateThemeList(self, theme_list):
|
def updateThemeList(self, theme_list):
|
||||||
"""
|
"""
|
||||||
@ -184,6 +185,7 @@ class ThemesTab(SettingsTab):
|
|||||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||||
self.global_theme)
|
self.global_theme)
|
||||||
preview = QtGui.QPixmap(unicode(image))
|
preview = QtGui.QPixmap(unicode(image))
|
||||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
if not preview.isNull():
|
||||||
QtCore.Qt.SmoothTransformation)
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
self.DefaultListView.setPixmap(display)
|
QtCore.Qt.SmoothTransformation)
|
||||||
|
self.DefaultListView.setPixmap(preview)
|
||||||
|
Loading…
Reference in New Issue
Block a user