From 6426d9aac4e01a8bff73b35916afb62df28350a1 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 2 Oct 2011 17:38:05 +0100 Subject: [PATCH] Display is now big enough --- openlp/core/ui/themeform.py | 6 +++--- openlp/core/ui/themelayoutdialog.py | 2 +- openlp/core/ui/themelayoutform.py | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index cbb83073d..064652488 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -246,6 +246,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.resizeEvent() def onCustom1ButtonClicked(self, number): + """ + Generate layout preview and display the form + """ width = self.thememanager.mainwindow.renderer.width height = self.thememanager.mainwindow.renderer.height pixmap = QtGui.QPixmap(width, height) @@ -260,7 +263,6 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): paint.end() self.themeLayoutForm.exec_(pixmap) - def onOutlineCheckCheckBoxStateChanged(self, state): """ Change state as Outline check box changed @@ -294,7 +296,6 @@ 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): """ @@ -303,7 +304,6 @@ 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): """ diff --git a/openlp/core/ui/themelayoutdialog.py b/openlp/core/ui/themelayoutdialog.py index d9770be23..58c09fb26 100644 --- a/openlp/core/ui/themelayoutdialog.py +++ b/openlp/core/ui/themelayoutdialog.py @@ -34,7 +34,7 @@ from openlp.core.lib.ui import create_accept_reject_button_box class Ui_ThemeLayoutDialog(object): def setupUi(self, themeLayoutDialog): themeLayoutDialog.setObjectName(u'themeLayoutDialogDialog') - themeLayoutDialog.resize(300, 200) + #themeLayoutDialog.resize(300, 200) self.previewLayout = QtGui.QVBoxLayout(themeLayoutDialog) self.previewLayout.setObjectName(u'PreviewLayout') self.previewArea = QtGui.QWidget(themeLayoutDialog) diff --git a/openlp/core/ui/themelayoutform.py b/openlp/core/ui/themelayoutform.py index b1984c01a..6f77d31da 100644 --- a/openlp/core/ui/themelayoutform.py +++ b/openlp/core/ui/themelayoutform.py @@ -44,11 +44,12 @@ class ThemeLayoutForm(QtGui.QDialog, Ui_ThemeLayoutDialog): """ Run the Dialog with correct heading. """ - pixmap = image.scaledToHeight(150, QtCore.Qt.SmoothTransformation) + pixmap = image.scaledToHeight(400, QtCore.Qt.SmoothTransformation) self.themeDisplayLabel.setPixmap(image) + displayAspectRatio = float(image.width()) / image.height() + self.themeDisplayLabel.setFixedSize(400, 400 / displayAspectRatio ) return QtGui.QDialog.exec_(self) def accept(self): return QtGui.QDialog.accept(self) -