forked from openlp/openlp
text resizes correctly when resizing the slidecontrollers, clean ups
This commit is contained in:
commit
43521fb506
@ -266,7 +266,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Creates the main widget for listing items the media item is tracking
|
Creates the main widget for listing items the media item is tracking
|
||||||
"""
|
"""
|
||||||
#Add the List widget
|
# Add the List widget
|
||||||
self.listView = self.ListViewWithDnD_class(self)
|
self.listView = self.ListViewWithDnD_class(self)
|
||||||
self.listView.uniformItemSizes = True
|
self.listView.uniformItemSizes = True
|
||||||
self.listView.setSpacing(1)
|
self.listView.setSpacing(1)
|
||||||
@ -275,9 +275,9 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
self.listView.setAlternatingRowColors(True)
|
self.listView.setAlternatingRowColors(True)
|
||||||
self.listView.setDragEnabled(True)
|
self.listView.setDragEnabled(True)
|
||||||
self.listView.setObjectName(u'%sListView' % self.plugin.name)
|
self.listView.setObjectName(u'%sListView' % self.plugin.name)
|
||||||
#Add to pageLayout
|
# Add to pageLayout
|
||||||
self.pageLayout.addWidget(self.listView)
|
self.pageLayout.addWidget(self.listView)
|
||||||
#define and add the context menu
|
# define and add the context menu
|
||||||
self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||||
name_string = self.plugin.getString(StringContent.Name)
|
name_string = self.plugin.getString(StringContent.Name)
|
||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
|
@ -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,10 +413,16 @@ 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))
|
||||||
|
# Make sure that the frames have the correct size.
|
||||||
|
self.PreviewListWidget.setColumnWidth(0,
|
||||||
|
self.PreviewListWidget.viewport().size().width())
|
||||||
|
if self.serviceItem:
|
||||||
|
# Sort out songs, bibles, etc.
|
||||||
|
if self.serviceItem.is_text():
|
||||||
|
self.PreviewListWidget.resizeRowsToContents()
|
||||||
|
else:
|
||||||
|
# Sort out image heights.
|
||||||
width = self.parent.ControlSplitter.sizes()[self.split]
|
width = self.parent.ControlSplitter.sizes()[self.split]
|
||||||
self.PreviewListWidget.setColumnWidth(0, width)
|
|
||||||
# Sort out image heights (Songs, bibles excluded)
|
|
||||||
if self.serviceItem and not self.serviceItem.is_text():
|
|
||||||
for framenumber in range(len(self.serviceItem.get_frames())):
|
for framenumber in range(len(self.serviceItem.get_frames())):
|
||||||
self.PreviewListWidget.setRowHeight(
|
self.PreviewListWidget.setRowHeight(
|
||||||
framenumber, width / self.ratio)
|
framenumber, width / self.ratio)
|
||||||
|
Loading…
Reference in New Issue
Block a user