More fixes

This commit is contained in:
Tim Bentley 2011-09-28 05:50:56 +01:00
parent 3e2e87bb2c
commit 632e2ce2dd

View File

@ -245,14 +245,14 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
pixmap = QtGui.QPixmap(width, height)
pixmap.fill(QtCore.Qt.white)
paint = QtGui.QPainter(pixmap)
paint.setPen(QtCore.Qt.blue)
paint.setPen(QtGui.QPen(QtCore.Qt.blue))
if not self.theme.font_main_override:
main_rect = QtCore.QRect(10, 0, width - 20, footer_start)
else:
main_rect = QtCore.QRect(self.theme.font_main_x, self.theme.font_main_y,
self.theme.font_main_width - 1, self.theme.font_main_height - 1)
paint.drawRect(main_rect)
paint.setPen(QtCore.Qt.red)
paint.setPen(QtGui.QPen(QtCore.Qt.red))
if not self.theme.font_footer_override:
footer_rect = QtCore.QRect(10, footer_start, width - 20,
height - footer_start)
@ -260,12 +260,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
footer_rect = QtCore.QRect(self.theme.font_footer_x,
self.theme.font_footer_y, self.theme.font_footer_width - 1,
self.theme.font_footer_height - 1)
print footer_rect
paint.drawRect(footer_rect)
paint.end()
pixmap = pixmap.scaled(100, 100 *
self.thememanager.mainwindow.renderer.screen_ratio,
QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
pixmap = pixmap.scaledToWidth(100, QtCore.Qt.SmoothTransformation)
self.themeLayoutLabel.setPixmap(pixmap)
self.displayAspectRatio = float(pixmap.width()) / pixmap.height()
self.resizeEvent()
@ -303,6 +300,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
"""
if self.updateThemeAllowed:
self.theme.font_main_override = not (value == QtCore.Qt.Checked)
self._generate_layout()
def onFooterPositionCheckBoxStateChanged(self, value):
"""
@ -311,6 +309,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
"""
if self.updateThemeAllowed:
self.theme.font_footer_override = not (value == QtCore.Qt.Checked)
self._generate_layout()
def exec_(self, edit=False):
"""