forked from openlp/openlp
tweaks
This commit is contained in:
parent
2ad441e883
commit
2837c36553
@ -56,8 +56,6 @@ class Renderer(object):
|
||||
self.bg_frame = None
|
||||
self.bg_image = None
|
||||
self.bg_image_bytes = None
|
||||
self.web = QtWebKit.QWebView()
|
||||
self.web.setVisible(False)
|
||||
|
||||
def set_theme(self, theme):
|
||||
"""
|
||||
@ -95,6 +93,8 @@ class Renderer(object):
|
||||
if self._theme.display_shadow:
|
||||
self.page_width -= int(self._theme.display_shadow_size)
|
||||
self.page_height -= int(self._theme.display_shadow_size)
|
||||
self.web = QtWebKit.QWebView()
|
||||
self.web.setVisible(False)
|
||||
self.web.resize(self.page_width, self.page_height)
|
||||
self.web_frame = self.web.page().mainFrame()
|
||||
# Adjust width and height to account for shadow. outline done in css
|
||||
|
@ -306,6 +306,7 @@ class MainDisplay(DisplayWidget):
|
||||
# We must have a service item to preview
|
||||
if not hasattr(self, u'serviceItem'):
|
||||
return
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
if self.isLive:
|
||||
# Wait for the fade to finish before geting the preview.
|
||||
# Important otherwise preview will have incorrect text if at all !
|
||||
@ -318,6 +319,8 @@ class MainDisplay(DisplayWidget):
|
||||
# Important otherwise first preview will miss the background !
|
||||
while not self.loaded:
|
||||
Receiver.send_message(u'openlp_process_events')
|
||||
if self.isLive:
|
||||
self.setVisible(True)
|
||||
preview = QtGui.QImage(self.screen[u'size'].width(),
|
||||
self.screen[u'size'].height(),
|
||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||
@ -326,8 +329,6 @@ class MainDisplay(DisplayWidget):
|
||||
self.frame.render(painter)
|
||||
painter.end()
|
||||
# Make display show up if in single screen mode
|
||||
if self.isLive:
|
||||
self.setVisible(True)
|
||||
return preview
|
||||
|
||||
def buildHtml(self, serviceItem):
|
||||
|
@ -636,9 +636,9 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
if not self.serviceItem:
|
||||
return
|
||||
Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive])
|
||||
if self.serviceItem.is_command():
|
||||
Receiver.send_message(u'%s_first' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive])
|
||||
self.updatePreview()
|
||||
else:
|
||||
self.PreviewListWidget.selectRow(0)
|
||||
@ -651,9 +651,9 @@ class SlideController(QtGui.QWidget):
|
||||
index = int(message[0])
|
||||
if not self.serviceItem:
|
||||
return
|
||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive, index])
|
||||
if self.serviceItem.is_command():
|
||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive, index])
|
||||
self.updatePreview()
|
||||
else:
|
||||
self.PreviewListWidget.selectRow(index)
|
||||
@ -768,9 +768,9 @@ class SlideController(QtGui.QWidget):
|
||||
row = self.PreviewListWidget.currentRow()
|
||||
self.selectedRow = 0
|
||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive, row])
|
||||
if self.serviceItem.is_command() and self.isLive:
|
||||
Receiver.send_message(u'%s_slide' % self.serviceItem.name.lower(),
|
||||
[self.serviceItem, self.isLive, row])
|
||||
self.updatePreview()
|
||||
else:
|
||||
frame, raw_html = self.serviceItem.get_rendered_frame(row)
|
||||
|
Loading…
Reference in New Issue
Block a user