clean ups

This commit is contained in:
Andreas Preikschat 2011-01-22 20:32:02 +01:00
parent 4ff9157adf
commit 425c50cdb4
2 changed files with 12 additions and 6 deletions

View File

@ -137,11 +137,10 @@ class MainDisplay(DisplayWidget):
painter_image.begin(initialFrame)
painter_image.fillRect(initialFrame.rect(), QtCore.Qt.white)
painter_image.drawImage(
(self.screens.current[u'size'].width() \
- splash_image.width()) / 2,
(self.screens.current[u'size'].height() \
- splash_image.height()) / 2,
splash_image)
(self.screens.current[u'size'].width() -
splash_image.width()) / 2,
(self.screens.current[u'size'].height()
- splash_image.height()) / 2, splash_image)
serviceItem = ServiceItem()
serviceItem.bg_image_bytes = image_to_byte(initialFrame)
self.webView.setHtml(build_html(serviceItem, self.screen,

View File

@ -899,7 +899,11 @@ class SlideController(QtGui.QWidget):
row)
def updatePreview(self):
log.debug(u'updatePreview %s ' %self.screens.current[u'primary'])
"""
This updates the preview frame, for example after changing a slide or
using *Blank to Theme*.
"""
log.debug(u'updatePreview %s ' % self.screens.current[u'primary'])
if not self.screens.current[u'primary']:
# Grab now, but try again in a couple of seconds if slide change
# is slow
@ -910,6 +914,9 @@ class SlideController(QtGui.QWidget):
QtGui.QPixmap.fromImage(self.display.preview()))
def grabMainDisplay(self):
"""
Creates an image of the current screen and updates the preview frame.
"""
winid = QtGui.QApplication.desktop().winId()
rect = self.screens.current[u'size']
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),