diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 87501602e..70d4b46ec 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -175,7 +175,7 @@ class ImageManager(QtCore.QObject): def update_images(self, image_type, background): """ - Screen has changed size so rebuild the cache to new size. + Border has changed so update all the images affected. """ log.debug(u'update_images') # Mark the images as dirty for a rebuild by setting the image and byte @@ -189,6 +189,22 @@ class ImageManager(QtCore.QObject): image.image_bytes = None self._conversion_queue.put((image.priority, image)) + def update_image(self, name, image_type, background): + """ + Border has changed so update the image affected. + """ + log.debug(u'update_images') + # Mark the images as dirty for a rebuild by setting the image and byte + # stream to None. + self._conversion_queue = PriorityQueue() + for key, image in self._cache.iteritems(): + if image.source == image_type and image.name == name: + image.background = background + image.priority = Priority.Normal + image.image = None + image.image_bytes = None + self._conversion_queue.put((image.priority, image)) + def process_updates(self): """ Flush the queue to updated any data to update diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 40b39b7fd..fdd0d74f3 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -612,8 +612,8 @@ class ThemeManager(QtGui.QWidget): self._writeTheme(theme, imageFrom, imageTo) if theme.background_type == \ BackgroundType.to_string(BackgroundType.Image): - self.mainwindow.imageManager.update_images(u'theme', - QtGui.QColor(theme.background_border_color)) + self.mainwindow.imageManager.update_image(theme.theme_name, + u'theme', QtGui.QColor(theme.background_border_color)) self.mainwindow.imageManager.process_updates() self.loadThemes()