render improvments part 1

This commit is contained in:
Tim Bentley 2009-09-15 18:45:32 +01:00
commit 9f6caa5426
2 changed files with 10 additions and 7 deletions

View File

@ -100,7 +100,10 @@ class ServiceItem(object):
for format in formated: for format in formated:
frame = self.RenderManager.generate_slide(format, frame = self.RenderManager.generate_slide(format,
self.raw_footer) self.raw_footer)
self.frames.append({u'title': slide[u'title'], lines = u''
for line in format:
lines += line + u'\n'
self.frames.append({u'title': slide[u'title'],u'text':lines,
u'image': frame}) u'image': frame})
elif self.service_item_type == ServiceType.Command: elif self.service_item_type == ServiceType.Command:
self.frames = self.service_frames self.frames = self.service_frames

View File

@ -166,7 +166,7 @@ class SlideController(QtGui.QWidget):
self.Toolbar.setSizePolicy(sizeToolbarPolicy) self.Toolbar.setSizePolicy(sizeToolbarPolicy)
# Screen preview area # Screen preview area
self.PreviewFrame = QtGui.QFrame(self.Splitter) self.PreviewFrame = QtGui.QFrame(self.Splitter)
self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, self.settingsmanager.slidecontroller_image, 225)) self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy( self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum)) QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum))
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel) self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
@ -293,12 +293,13 @@ class SlideController(QtGui.QWidget):
self.PreviewListWidget.setColumnWidth(0, slide_width) self.PreviewListWidget.setColumnWidth(0, slide_width)
for framenumber, frame in enumerate(self.serviceitem.frames): for framenumber, frame in enumerate(self.serviceitem.frames):
self.PreviewListWidget.setRowCount(self.PreviewListWidget.rowCount() + 1) self.PreviewListWidget.setRowCount(self.PreviewListWidget.rowCount() + 1)
pixmap = self.parent.RenderManager.resize_image(frame[u'image'], slide_width, slide_height) #pixmap = self.parent.RenderManager.resize_image(frame[u'image'], slide_width, slide_height)
item = QtGui.QTableWidgetItem() item = QtGui.QTableWidgetItem()
label = QtGui.QLabel() label = QtGui.QLabel()
label.setMargin(8) label.setMargin(8)
label.setScaledContents(True) #label.setScaledContents(True)
label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) label.setText(frame[u'text'])
#label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
self.PreviewListWidget.setCellWidget(framenumber, 0, label) self.PreviewListWidget.setCellWidget(framenumber, 0, label)
self.PreviewListWidget.setItem(framenumber, 0, item) self.PreviewListWidget.setItem(framenumber, 0, item)
self.PreviewListWidget.setRowHeight(framenumber, slide_height) self.PreviewListWidget.setRowHeight(framenumber, slide_height)
@ -335,9 +336,8 @@ class SlideController(QtGui.QWidget):
row = self.PreviewListWidget.currentRow() row = self.PreviewListWidget.currentRow()
if row > -1 and row < self.PreviewListWidget.rowCount(): if row > -1 and row < self.PreviewListWidget.rowCount():
label = self.PreviewListWidget.cellWidget(row, 0) label = self.PreviewListWidget.cellWidget(row, 0)
smallframe = label.pixmap()
frame = self.serviceitem.frames[row][u'image'] frame = self.serviceitem.frames[row][u'image']
self.SlidePreview.setPixmap(smallframe) self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
if self.isLive: if self.isLive:
self.parent.mainDisplay.frameView(frame) self.parent.mainDisplay.frameView(frame)