forked from openlp/openlp
Fixed a bug with transparent backgrounds.
bzr-revno: 758
This commit is contained in:
commit
f6e6357176
@ -144,6 +144,7 @@ def resize_image(image, width, height):
|
|||||||
The image to resize.
|
The image to resize.
|
||||||
"""
|
"""
|
||||||
preview = QtGui.QImage(image)
|
preview = QtGui.QImage(image)
|
||||||
|
if not preview.isNull():
|
||||||
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
||||||
QtCore.Qt.SmoothTransformation)
|
QtCore.Qt.SmoothTransformation)
|
||||||
realw = preview.width()
|
realw = preview.width()
|
||||||
|
@ -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():
|
||||||
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
QtCore.Qt.SmoothTransformation)
|
QtCore.Qt.SmoothTransformation)
|
||||||
self.DefaultListView.setPixmap(display)
|
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():
|
||||||
|
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||||
QtCore.Qt.SmoothTransformation)
|
QtCore.Qt.SmoothTransformation)
|
||||||
self.DefaultListView.setPixmap(display)
|
self.DefaultListView.setPixmap(preview)
|
||||||
|
Loading…
Reference in New Issue
Block a user