forked from openlp/openlp
Clean up slide controller
This commit is contained in:
parent
c191a7b232
commit
5046b31f16
@ -194,9 +194,7 @@ class RenderManager(object):
|
||||
The words to go on the slides.
|
||||
"""
|
||||
log.debug(u'format slide')
|
||||
#self.calculate_default(self.screen_list[self.current_display][u'size'])
|
||||
self.build_text_rectangle(self.themedata)
|
||||
#self.renderer.set_frame_dest(self.width, self.height)
|
||||
return self.renderer.format_slide(words, False)
|
||||
|
||||
def generate_slide(self, main_text, footer_text):
|
||||
@ -254,6 +252,7 @@ class RenderManager(object):
|
||||
else:
|
||||
self.width = screen.width()
|
||||
self.height = screen.height()
|
||||
log.debug(u'calculate default %d, %d', self.width, self.height)
|
||||
self.screen_ratio = float(self.height) / float(self.width)
|
||||
log.debug(u'calculate default %d, %d, %f', self.width, self.height, self.screen_ratio )
|
||||
# 90% is start of footer
|
||||
self.footer_start = int(self.height * 0.90)
|
||||
|
@ -157,13 +157,6 @@ class SlideController(QtGui.QWidget):
|
||||
self.DelaySpinBox.setSuffix(translate(u'SlideController', u's'))
|
||||
|
||||
self.ControllerLayout.addWidget(self.Toolbar)
|
||||
#sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
|
||||
# QtGui.QSizePolicy.Fixed)
|
||||
#sizeToolbarPolicy.setHorizontalStretch(0)
|
||||
#sizeToolbarPolicy.setVerticalStretch(0)
|
||||
#sizeToolbarPolicy.setHeightForWidth(
|
||||
# self.Toolbar.sizePolicy().hasHeightForWidth())
|
||||
#self.Toolbar.setSizePolicy(sizeToolbarPolicy)
|
||||
# Screen preview area
|
||||
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
||||
self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
|
||||
@ -284,29 +277,26 @@ class SlideController(QtGui.QWidget):
|
||||
log.debug(u'displayServiceManagerItems Start')
|
||||
before = time.time()
|
||||
self.serviceitem = serviceitem
|
||||
slide_image = self.serviceitem.frames[0][u'image']
|
||||
size = slide_image.size()
|
||||
slide_width = self.settingsmanager.slidecontroller_image
|
||||
slide_height = slide_width * size.height() / size.width()
|
||||
self.PreviewListWidget.clear()
|
||||
self.PreviewListWidget.setRowCount(0)
|
||||
self.PreviewListWidget.setColumnWidth(0, slide_width)
|
||||
self.PreviewListWidget.setColumnWidth(0, self.settingsmanager.slidecontroller_image)
|
||||
for framenumber, frame in enumerate(self.serviceitem.frames):
|
||||
self.PreviewListWidget.setRowCount(self.PreviewListWidget.rowCount() + 1)
|
||||
item = QtGui.QTableWidgetItem()
|
||||
label = QtGui.QLabel()
|
||||
label.setMargin(8)
|
||||
#It is a Image
|
||||
if frame[u'text'] == None:
|
||||
pixmap = self.parent.RenderManager.resize_image(frame[u'image'], slide_width, slide_height)
|
||||
pixmap = self.parent.RenderManager.resize_image(frame[u'image'])
|
||||
label.setScaledContents(True)
|
||||
label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
|
||||
else:
|
||||
label.setText(frame[u'text'])
|
||||
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
||||
self.PreviewListWidget.setItem(framenumber, 0, item)
|
||||
slide_height = self.settingsmanager.slidecontroller_image * self.parent.RenderManager.screen_ratio
|
||||
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
|
||||
slide_width = self.PreviewListWidget.viewport().size().width()
|
||||
self.PreviewListWidget.setColumnWidth(0, slide_width)
|
||||
self.PreviewListWidget.setColumnWidth(0, self.PreviewListWidget.viewport().size().width())
|
||||
if slideno > self.PreviewListWidget.rowCount():
|
||||
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount())
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user