openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00836
[Merge] lp:~trb143/openlp/fixes into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Fix sizing of Images in SlideControllers
Fix handling of Splitter controls so items resize correctly.
--
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14624
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/settingsmanager.py'
--- openlp/core/lib/settingsmanager.py 2009-11-07 00:00:36 +0000
+++ openlp/core/lib/settingsmanager.py 2009-11-08 17:55:18 +0000
@@ -45,7 +45,6 @@
else:
self.mainwindow_left = mainwindow_docbars
self.mainwindow_right = mainwindow_docbars
-
self.slidecontroller = (self.width - (
self.mainwindow_left + self.mainwindow_right) - 100 ) / 2
self.slidecontroller_image = self.slidecontroller - 50
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-11-08 14:16:02 +0000
+++ openlp/core/ui/mainwindow.py 2009-11-08 17:55:18 +0000
@@ -84,6 +84,7 @@
MainWindow.setCentralWidget(self.MainContent)
self.ControlSplitter = QtGui.QSplitter(self.MainContent)
self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)
+ self.ControlSplitter.setOpaqueResize(False)
self.ControlSplitter.setObjectName(u'ControlSplitter')
self.MainContentLayout.addWidget(self.ControlSplitter)
# Create slide controllers
@@ -305,8 +306,11 @@
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def trackSplitter(self, tab, pos):
- #print tab, pos
- pass
+ """
+ Splitter between the Preview and Live Controllers.
+ """
+ self.LiveController.widthChanged()
+ self.PreviewController.widthChanged()
def retranslateUi(self, MainWindow):
"""
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-11-08 13:56:25 +0000
+++ openlp/core/ui/slidecontroller.py 2009-11-08 17:55:18 +0000
@@ -108,14 +108,17 @@
if self.isLive:
self.TypeLabel.setText(u'<strong>%s</strong>' %
self.trUtf8(u'Live'))
+ self.split = 1
else:
self.TypeLabel.setText(u'<strong>%s</strong>' %
self.trUtf8(u'Preview'))
+ self.split = 0
self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
self.PanelLayout.addWidget(self.TypeLabel)
# Splitter
self.Splitter = QtGui.QSplitter(self.Panel)
self.Splitter.setOrientation(QtCore.Qt.Vertical)
+ self.Splitter.setOpaqueResize(False)
self.PanelLayout.addWidget(self.Splitter)
# Actual controller section
self.Controller = QtGui.QWidget(self.Splitter)
@@ -136,6 +139,7 @@
self.PreviewListWidget.setObjectName(u'PreviewListWidget')
self.PreviewListWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
+ self.PreviewListWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.ControllerLayout.addWidget(self.PreviewListWidget)
# Build the full toolbar
self.Toolbar = OpenLPToolbar(self)
@@ -195,7 +199,6 @@
self.Toolbar.addToolbarButton(
u'Media Stop', u':/slides/media_playback_stop.png',
self.trUtf8(u'Start playing media'), self.onMediaStop)
-
self.ControllerLayout.addWidget(self.Toolbar)
# Build the Song Toolbar
if isLive:
@@ -273,6 +276,30 @@
QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange)
+ QtCore.QObject.connect(self.Splitter,
+ QtCore.SIGNAL(u'splitterMoved(int, int)'), self.trackSplitter)
+
+ def widthChanged(self):
+ """
+ Handle changes of width from the splitter between the live and preview
+ controller. Event only issues when changes have finished
+ """
+ if not self.commandItem:
+ return
+ width = self.parent.ControlSplitter.sizes()[self.split]
+ height = width * self.parent.RenderManager.screen_ratio
+ self.PreviewListWidget.setColumnWidth(0, width)
+ for framenumber, frame in enumerate(self.commandItem.frames):
+ if frame[u'text']:
+ break
+ self.PreviewListWidget.setRowHeight(framenumber, height)
+
+
+ def trackSplitter(self, tab, pos):
+ """
+ Splitter between the slide list and the preview panel
+ """
+ pass
def onSongBarHandler(self):
request = self.sender().text()
@@ -403,14 +430,14 @@
Display the slide number passed
"""
log.debug(u'displayServiceManagerItems Start')
+ width = self.parent.ControlSplitter.sizes()[self.split]
#Set pointing cursor when we have somthing to point at
self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor)
before = time.time()
self.serviceitem = serviceitem
self.PreviewListWidget.clear()
self.PreviewListWidget.setRowCount(0)
- self.PreviewListWidget.setColumnWidth(
- 0, self.settingsmanager.slidecontroller_image)
+ self.PreviewListWidget.setColumnWidth(0, width)
for framenumber, frame in enumerate(self.serviceitem.frames):
self.PreviewListWidget.setRowCount(
self.PreviewListWidget.rowCount() + 1)
@@ -424,8 +451,7 @@
label.setScaledContents(True)
label.setPixmap(QtGui.QPixmap.fromImage(pixmap))
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
- slide_height = self.settingsmanager.slidecontroller_image * \
- self.parent.RenderManager.screen_ratio
+ slide_height = width * self.parent.RenderManager.screen_ratio
else:
item.setText(frame[u'text'])
self.PreviewListWidget.setItem(framenumber, 0, item)
Follow ups