forked from openlp/openlp
Fix slidecontroller resizing and cleanups
bzr-revno: 1215
This commit is contained in:
commit
aa9fe688bf
@ -314,7 +314,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
context_menu_action(
|
context_menu_action(
|
||||||
self.listView, u':/general/general_add.png',
|
self.listView, u':/general/general_add.png',
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'&Add to selected Service Item'),
|
'&Add to selected Service Item'),
|
||||||
self.onAddEditClick))
|
self.onAddEditClick))
|
||||||
QtCore.QObject.connect(self.listView,
|
QtCore.QObject.connect(self.listView,
|
||||||
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
|
||||||
@ -441,7 +441,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
|
||||||
translate('OpenLP.MediaManagerItem',
|
translate('OpenLP.MediaManagerItem',
|
||||||
'You must select one or more items to preview.'))
|
'You must select one or more items to preview.'))
|
||||||
else:
|
else:
|
||||||
log.debug(u'%s Preview requested', self.plugin.name)
|
log.debug(u'%s Preview requested', self.plugin.name)
|
||||||
serviceItem = self.buildServiceItem()
|
serviceItem = self.buildServiceItem()
|
||||||
|
@ -60,6 +60,7 @@ class ItemCapabilities(object):
|
|||||||
AddIfNewItem = 9
|
AddIfNewItem = 9
|
||||||
ProvidesOwnDisplay = 10
|
ProvidesOwnDisplay = 10
|
||||||
|
|
||||||
|
|
||||||
class ServiceItem(object):
|
class ServiceItem(object):
|
||||||
"""
|
"""
|
||||||
The service item is a base class for the plugins to use to interact with
|
The service item is a base class for the plugins to use to interact with
|
||||||
|
@ -399,7 +399,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
def previewSizeChanged(self):
|
def previewSizeChanged(self):
|
||||||
"""
|
"""
|
||||||
Takes care of the SlidePreview's size. Is called when one of the the
|
Takes care of the SlidePreview's size. Is called when one of the the
|
||||||
splitters is moved or when the screen size is changed.
|
splitters is moved or when the screen size is changed. Note, that this
|
||||||
|
method is (also) called frequently from the mainwindow *paintEvent*.
|
||||||
"""
|
"""
|
||||||
if self.ratio < float(self.PreviewFrame.width()) / float(
|
if self.ratio < float(self.PreviewFrame.width()) / float(
|
||||||
self.PreviewFrame.height()):
|
self.PreviewFrame.height()):
|
||||||
@ -412,13 +413,19 @@ class SlideController(QtGui.QWidget):
|
|||||||
max_width = self.PreviewFrame.width() - self.grid.margin() * 2
|
max_width = self.PreviewFrame.width() - self.grid.margin() * 2
|
||||||
self.SlidePreview.setFixedSize(QtCore.QSize(max_width,
|
self.SlidePreview.setFixedSize(QtCore.QSize(max_width,
|
||||||
max_width / self.ratio))
|
max_width / self.ratio))
|
||||||
width = self.parent.ControlSplitter.sizes()[self.split]
|
# Make sure that the frames have the correct size.
|
||||||
self.PreviewListWidget.setColumnWidth(0, width)
|
self.PreviewListWidget.setColumnWidth(0,
|
||||||
# Sort out image heights (Songs, bibles excluded)
|
self.PreviewListWidget.viewport().size().width())
|
||||||
if self.serviceItem and not self.serviceItem.is_text():
|
if self.serviceItem:
|
||||||
for framenumber in range(len(self.serviceItem.get_frames())):
|
# Sort out songs, bibles, etc.
|
||||||
self.PreviewListWidget.setRowHeight(
|
if self.serviceItem.is_text():
|
||||||
framenumber, width / self.ratio)
|
self.PreviewListWidget.resizeRowsToContents()
|
||||||
|
else:
|
||||||
|
# Sort out image heights.
|
||||||
|
width = self.parent.ControlSplitter.sizes()[self.split]
|
||||||
|
for framenumber in range(len(self.serviceItem.get_frames())):
|
||||||
|
self.PreviewListWidget.setRowHeight(
|
||||||
|
framenumber, width / self.ratio)
|
||||||
|
|
||||||
def onSongBarHandler(self):
|
def onSongBarHandler(self):
|
||||||
request = unicode(self.sender().text())
|
request = unicode(self.sender().text())
|
||||||
@ -590,7 +597,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.parent.renderManager.height)
|
self.parent.renderManager.height)
|
||||||
else:
|
else:
|
||||||
image = self.parent.renderManager.image_manager. \
|
image = self.parent.renderManager.image_manager. \
|
||||||
get_image(frame[u'title'])
|
get_image(frame[u'title'])
|
||||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||||
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
||||||
slideHeight = width * self.parent.renderManager.screen_ratio
|
slideHeight = width * self.parent.renderManager.screen_ratio
|
||||||
|
Loading…
Reference in New Issue
Block a user