forked from openlp/openlp
Make sure images use the configured background/border color when loaded from a saved service file
This commit is contained in:
parent
14430e3a56
commit
2ce3f7d512
@ -36,8 +36,9 @@ import datetime
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource
|
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -405,13 +406,15 @@ class ServiceItem(object):
|
|||||||
for slide in serviceitem[u'serviceitem'][u'data']:
|
for slide in serviceitem[u'serviceitem'][u'data']:
|
||||||
self._raw_frames.append(slide)
|
self._raw_frames.append(slide)
|
||||||
elif self.service_item_type == ServiceItemType.Image:
|
elif self.service_item_type == ServiceItemType.Image:
|
||||||
|
settingsSection = serviceitem[u'serviceitem'][u'header'][u'name']
|
||||||
|
background = QtGui.QColor(Settings().value(settingsSection + u'/background color', u'#000000'))
|
||||||
if path:
|
if path:
|
||||||
for text_image in serviceitem[u'serviceitem'][u'data']:
|
for text_image in serviceitem[u'serviceitem'][u'data']:
|
||||||
filename = os.path.join(path, text_image)
|
filename = os.path.join(path, text_image)
|
||||||
self.add_from_image(filename, text_image)
|
self.add_from_image(filename, text_image, background)
|
||||||
else:
|
else:
|
||||||
for text_image in serviceitem[u'serviceitem'][u'data']:
|
for text_image in serviceitem[u'serviceitem'][u'data']:
|
||||||
self.add_from_image(text_image[u'path'], text_image[u'title'])
|
self.add_from_image(text_image[u'path'], text_image[u'title'], background)
|
||||||
elif self.service_item_type == ServiceItemType.Command:
|
elif self.service_item_type == ServiceItemType.Command:
|
||||||
for text_image in serviceitem[u'serviceitem'][u'data']:
|
for text_image in serviceitem[u'serviceitem'][u'data']:
|
||||||
if path:
|
if path:
|
||||||
|
Loading…
Reference in New Issue
Block a user