From 2d8073fcb5da1496867b09d4ab13317a3c18a382 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 18 Oct 2009 17:09:09 +0200 Subject: [PATCH 01/13] Lighten the gradient of the toolbox titles. --- openlp/core/ui/mainwindow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 995b53f3c..4a655512d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -38,7 +38,7 @@ from openlp.core.utils import check_latest_version media_manager_style = """ QToolBox::tab { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(midlight), stop: 1.0 palette(dark)); + stop: 0 palette(midlight), stop: 1.0 palette(mid)); border-width: 1px; border-style: outset; border-color: palette(midlight); @@ -46,7 +46,7 @@ media_manager_style = """ } QToolBox::tab:selected { background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 palette(light), stop: 1.0 palette(dark)); + stop: 0 palette(light), stop: 1.0 palette(mid)); border-color: palette(light); } """ From 804d7ea2ec4392d758c7cd28b561b014d463549b Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 18 Oct 2009 17:56:59 +0200 Subject: [PATCH 02/13] Add more spacing in the dock widget titles (on Windows). --- openlp.pyw | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp.pyw b/openlp.pyw index 98faf8b03..6a8c82552 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -47,7 +47,8 @@ QMainWindow::separator QDockWidget::title { border: none; - padding-left: 2px; + padding-left: 5px; + padding-top: 3px; } """ From d2c8d8bbce6a8965b7d09827d19472e8c912ecd1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 18 Oct 2009 19:06:34 +0200 Subject: [PATCH 03/13] Some more style fixes for Windows; Fixed spacing on Songs media manager. --- openlp.pyw | 7 +++++++ openlp/plugins/songs/lib/mediaitem.py | 1 + 2 files changed, 8 insertions(+) diff --git a/openlp.pyw b/openlp.pyw index 6a8c82552..178ef6963 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -50,6 +50,13 @@ QDockWidget::title padding-left: 5px; padding-top: 3px; } + +QToolBar +{ + border: none; + /*margin: 0;*/ + padding: 0; +} """ class OpenLP(QtGui.QApplication): diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index ed6978628..1037463c3 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -68,6 +68,7 @@ class SongMediaItem(MediaManagerItem): u'Maintain the lists of authors, topics and books'), ':/songs/song_maintenance.png', self.onSongMaintenanceClick, 'SongMaintenanceItem') + self.PageLayout.setSpacing(4) self.SearchLayout = QtGui.QFormLayout() self.SearchLayout.setMargin(0) self.SearchLayout.setSpacing(4) From 4d83753b107a606b3d5aab5d606a143b0ae59d8a Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 18 Oct 2009 20:15:20 +0200 Subject: [PATCH 04/13] Tidied up the bible media manager item. --- openlp.pyw | 2 +- openlp/plugins/bibles/lib/mediaitem.py | 120 +++++++++++++++---------- 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 178ef6963..ebd449bf8 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -54,7 +54,7 @@ QDockWidget::title QToolBar { border: none; - /*margin: 0;*/ + margin: 0; padding: 0; } """ diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index e0725ea67..1ef176625 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -77,113 +77,135 @@ class BibleMediaItem(MediaManagerItem): # Add the Quick Search tab self.QuickTab = QtGui.QWidget() self.QuickTab.setObjectName(u'QuickTab') - self.QuickVerticalLayout = QtGui.QVBoxLayout(self.QuickTab) - self.QuickVerticalLayout.setObjectName("verticalLayout") - self.QuickLayout = QtGui.QGridLayout() - self.QuickLayout.setMargin(0) + self.QuickLayout = QtGui.QGridLayout(self.QuickTab) + self.QuickLayout.setMargin(2) self.QuickLayout.setSpacing(4) + self.QuickLayout.setVerticalSpacing(4) self.QuickLayout.setObjectName(u'QuickLayout') self.QuickVersionLabel = QtGui.QLabel(self.QuickTab) self.QuickVersionLabel.setObjectName(u'QuickVersionLabel') self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1) self.QuickVersionComboBox = QtGui.QComboBox(self.QuickTab) + self.QuickVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickVersionComboBox.setObjectName(u'VersionComboBox') self.QuickLayout.addWidget(self.QuickVersionComboBox, 0, 1, 1, 2) - self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) - self.QuickSearchLabel.setObjectName(u'QuickSearchLabel') - self.QuickLayout.addWidget(self.QuickSearchLabel, 1, 0, 1, 1) - self.QuickSearchComboBox = QtGui.QComboBox(self.QuickTab) - self.QuickSearchComboBox.setObjectName(u'SearchComboBox') - self.QuickLayout.addWidget(self.QuickSearchComboBox, 1, 1, 1, 2) + self.QuickDualVersionLabel = QtGui.QLabel(self.QuickTab) + self.QuickDualVersionLabel.setObjectName(u'QuickDualVersionLabel') + self.QuickLayout.addWidget(self.QuickDualVersionLabel, 1, 0, 1, 1) + self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab) + self.QuickSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) + self.QuickSecondBibleComboBox.setObjectName(u'SecondBible') + self.QuickLayout.addWidget(self.QuickSecondBibleComboBox, 1, 1, 1, 2) self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) self.QuickSearchLabel.setObjectName(u'QuickSearchLabel') self.QuickLayout.addWidget(self.QuickSearchLabel, 2, 0, 1, 1) + self.QuickSearchComboBox = QtGui.QComboBox(self.QuickTab) + self.QuickSearchComboBox.setObjectName(u'SearchComboBox') + self.QuickLayout.addWidget(self.QuickSearchComboBox, 2, 1, 1, 2) + self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) + self.QuickSearchLabel.setObjectName(u'QuickSearchLabel') + self.QuickLayout.addWidget(self.QuickSearchLabel, 3, 0, 1, 1) self.QuickSearchEdit = QtGui.QLineEdit(self.QuickTab) self.QuickSearchEdit.setObjectName(u'QuickSearchEdit') - self.QuickLayout.addWidget(self.QuickSearchEdit, 2, 1, 1, 2) - self.QuickSearchButton = QtGui.QPushButton(self.QuickTab) - self.QuickSearchButton.setObjectName(u'QuickSearchButton') - self.QuickLayout.addWidget(self.QuickSearchButton, 3, 2, 1, 1) + self.QuickLayout.addWidget(self.QuickSearchEdit, 3, 1, 1, 2) self.QuickClearLabel = QtGui.QLabel(self.QuickTab) self.QuickClearLabel.setObjectName(u'QuickSearchLabel') - self.QuickLayout.addWidget(self.QuickClearLabel, 3, 0, 1, 1) + self.QuickLayout.addWidget(self.QuickClearLabel, 4, 0, 1, 1) self.ClearQuickSearchComboBox = QtGui.QComboBox(self.QuickTab) self.ClearQuickSearchComboBox.setObjectName(u'ClearQuickSearchComboBox') - self.QuickLayout.addWidget(self.ClearQuickSearchComboBox, 3, 1, 1, 1) - self.QuickVerticalLayout.addLayout(self.QuickLayout) - self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab) - self.QuickSecondBibleComboBox.setObjectName(u'SecondBible') - self.QuickVerticalLayout.addWidget(self.QuickSecondBibleComboBox) + self.QuickLayout.addWidget(self.ClearQuickSearchComboBox, 4, 1, 1, 2) + self.QuickSearchButtonLayout = QtGui.QHBoxLayout() + self.QuickSearchButtonLayout.setMargin(0) + self.QuickSearchButtonLayout.setSpacing(0) + self.QuickSearchButtonLayout.setObjectName(u'QuickSearchButtonLayout') + self.QuickSearchButtonSpacer = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.QuickSearchButtonLayout.addItem(self.QuickSearchButtonSpacer) + self.QuickSearchButton = QtGui.QPushButton(self.QuickTab) + self.QuickSearchButton.setObjectName(u'QuickSearchButton') + self.QuickSearchButtonLayout.addWidget(self.QuickSearchButton) + self.QuickLayout.addLayout(self.QuickSearchButtonLayout, 5, 0, 1, 3) self.QuickMessage = QtGui.QLabel(self.QuickTab) self.QuickMessage.setObjectName(u'QuickMessage') - self.QuickVerticalLayout.addWidget(self.QuickMessage) + self.QuickLayout.addWidget(self.QuickMessage, 5, 0, 1, 3) self.SearchTabWidget.addTab(self.QuickTab, 'Quick') QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.QuickLayout.addItem(QuickSpacerItem, 4, 2, 1, 1) + self.QuickLayout.addItem(QuickSpacerItem, 6, 2, 1, 1) # Add the Advanced Search tab self.AdvancedTab = QtGui.QWidget() self.AdvancedTab.setObjectName(u'AdvancedTab') - self.AdvancedVerticalLayout = QtGui.QVBoxLayout(self.AdvancedTab) - self.AdvancedVerticalLayout.setObjectName("verticalLayout") - self.AdvancedLayout = QtGui.QGridLayout() - self.AdvancedLayout.setMargin(0) + self.AdvancedLayout = QtGui.QGridLayout(self.AdvancedTab) + self.AdvancedLayout.setMargin(2) self.AdvancedLayout.setSpacing(4) + self.AdvancedLayout.setVerticalSpacing(4) self.AdvancedLayout.setObjectName(u'AdvancedLayout') self.AdvancedVersionLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel') self.AdvancedLayout.addWidget(self.AdvancedVersionLabel, 0, 0, 1, 1) self.AdvancedVersionComboBox = QtGui.QComboBox(self.AdvancedTab) + self.AdvancedVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.AdvancedVersionComboBox.setObjectName(u'AdvancedVersionComboBox') - self.AdvancedLayout.addWidget(self.AdvancedVersionComboBox, 0, 2, 1, 2) + self.AdvancedLayout.addWidget(self.AdvancedVersionComboBox, 0, 1, 1, 2) + self.AdvancedSecondBibleLabel = QtGui.QLabel(self.AdvancedTab) + self.AdvancedSecondBibleLabel.setObjectName(u'AdvancedSecondBibleLabel') + self.AdvancedLayout.addWidget(self.AdvancedSecondBibleLabel, 1, 0, 1, 1) + self.AdvancedSecondBibleComboBox = QtGui.QComboBox(self.AdvancedTab) + self.AdvancedSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) + self.AdvancedSecondBibleComboBox.setObjectName(u'AdvancedSecondBibleComboBox') + self.AdvancedLayout.addWidget(self.AdvancedSecondBibleComboBox, 1, 1, 1, 2) self.AdvancedBookLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedBookLabel.setObjectName(u'AdvancedBookLabel') - self.AdvancedLayout.addWidget(self.AdvancedBookLabel, 1, 0, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedBookLabel, 2, 0, 1, 1) self.AdvancedBookComboBox = QtGui.QComboBox(self.AdvancedTab) self.AdvancedBookComboBox.setObjectName(u'AdvancedBookComboBox') - self.AdvancedLayout.addWidget(self.AdvancedBookComboBox, 1, 2, 1, 2) + self.AdvancedLayout.addWidget(self.AdvancedBookComboBox, 2, 1, 1, 2) self.AdvancedChapterLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedChapterLabel.setObjectName(u'AdvancedChapterLabel') - self.AdvancedLayout.addWidget(self.AdvancedChapterLabel, 2, 2, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedChapterLabel, 3, 1, 1, 1) self.AdvancedVerseLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedVerseLabel.setObjectName(u'AdvancedVerseLabel') - self.AdvancedLayout.addWidget(self.AdvancedVerseLabel, 2, 3, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedVerseLabel, 3, 2, 1, 1) self.AdvancedFromLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedFromLabel.setObjectName(u'AdvancedFromLabel') - self.AdvancedLayout.addWidget(self.AdvancedFromLabel, 3, 0, 1, 1) - self.AdvancedToLabel = QtGui.QLabel(self.AdvancedTab) - self.AdvancedToLabel.setObjectName(u'AdvancedToLabel') - self.AdvancedLayout.addWidget(self.AdvancedToLabel, 4, 0, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedFromLabel, 4, 0, 1, 1) self.AdvancedFromChapter = QtGui.QComboBox(self.AdvancedTab) self.AdvancedFromChapter.setObjectName(u'AdvancedFromChapter') - self.AdvancedLayout.addWidget(self.AdvancedFromChapter, 3, 2, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedFromChapter, 4, 1, 1, 1) self.AdvancedFromVerse = QtGui.QComboBox(self.AdvancedTab) self.AdvancedFromVerse.setObjectName(u'AdvancedFromVerse') - self.AdvancedLayout.addWidget(self.AdvancedFromVerse, 3, 3, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedFromVerse, 4, 2, 1, 1) + self.AdvancedToLabel = QtGui.QLabel(self.AdvancedTab) + self.AdvancedToLabel.setObjectName(u'AdvancedToLabel') + self.AdvancedLayout.addWidget(self.AdvancedToLabel, 5, 0, 1, 1) self.AdvancedToChapter = QtGui.QComboBox(self.AdvancedTab) self.AdvancedToChapter.setObjectName(u'AdvancedToChapter') - self.AdvancedLayout.addWidget(self.AdvancedToChapter, 4, 2, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedToChapter, 5, 1, 1, 1) self.AdvancedToVerse = QtGui.QComboBox(self.AdvancedTab) self.AdvancedToVerse.setObjectName(u'AdvancedToVerse') - self.AdvancedLayout.addWidget(self.AdvancedToVerse, 4, 3, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedToVerse, 5, 2, 1, 1) self.AdvancedClearLabel = QtGui.QLabel(self.QuickTab) self.AdvancedClearLabel.setObjectName(u'QuickSearchLabel') - self.AdvancedLayout.addWidget(self.AdvancedClearLabel, 5, 0, 1, 1) + self.AdvancedLayout.addWidget(self.AdvancedClearLabel, 6, 0, 1, 1) self.ClearAdvancedSearchComboBox = QtGui.QComboBox(self.QuickTab) self.ClearAdvancedSearchComboBox.setObjectName( u'ClearAdvancedSearchComboBox') self.AdvancedLayout.addWidget( - self.ClearAdvancedSearchComboBox, 5, 2, 1, 2) + self.ClearAdvancedSearchComboBox, 6, 1, 1, 2) + self.AdvancedSearchButtonLayout = QtGui.QHBoxLayout() + self.AdvancedSearchButtonLayout.setMargin(0) + self.AdvancedSearchButtonLayout.setSpacing(0) + self.AdvancedSearchButtonLayout.setObjectName(u'AdvancedSearchButtonLayout') + self.AdvancedSearchButtonSpacer = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.AdvancedSearchButtonLayout.addItem(self.AdvancedSearchButtonSpacer) self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab) self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton') - self.AdvancedLayout.addWidget(self.AdvancedSearchButton, 6, 3, 1, 1) - self.AdvancedVerticalLayout.addLayout(self.AdvancedLayout) - self.AdvancedSecondBibleComboBox = QtGui.QComboBox(self.AdvancedTab) - self.AdvancedSecondBibleComboBox.setObjectName(u'SecondBible') - self.AdvancedVerticalLayout.addWidget(self.AdvancedSecondBibleComboBox) + self.AdvancedSearchButtonLayout.addWidget(self.AdvancedSearchButton) + self.AdvancedLayout.addLayout(self.AdvancedSearchButtonLayout, 7, 0, 1, 3) self.AdvancedMessage = QtGui.QLabel(self.QuickTab) self.AdvancedMessage.setObjectName(u'AdvancedMessage') - self.AdvancedVerticalLayout.addWidget(self.AdvancedMessage) + self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') # Add the search tab widget to the page layout self.PageLayout.addWidget(self.SearchTabWidget) @@ -208,6 +230,8 @@ class BibleMediaItem(MediaManagerItem): log.debug(u'retranslateUi') self.QuickVersionLabel.setText( translate(u'BibleMediaItem', u'Version:')) + self.QuickDualVersionLabel.setText( + translate(u'BibleMediaItem', u'Dual:')) self.QuickSearchLabel.setText( translate(u'BibleMediaItem', u'Search Type:')) self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Find:')) @@ -215,6 +239,8 @@ class BibleMediaItem(MediaManagerItem): self.QuickClearLabel.setText(translate(u'BibleMediaItem', u'Results:')) self.AdvancedVersionLabel.setText( translate(u'BibleMediaItem', u'Version:')) + self.AdvancedSecondBibleLabel.setText( + translate(u'BibleMediaItem', u'Dual:')) self.AdvancedBookLabel.setText(translate(u'BibleMediaItem', u'Book:')) self.AdvancedChapterLabel.setText( translate(u'BibleMediaItem', u'Chapter:')) From ca96d0fda6c7a04d582086cebff8af5a01739096 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 20 Oct 2009 17:33:00 +0100 Subject: [PATCH 05/13] SlideControler UI fixes --- openlp/core/ui/slidecontroller.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e18e1b8cc..47ffefcbb 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -28,6 +28,16 @@ import time from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType +label_stylesheet = u""" +QTableWidget::item:selected +{ + border: 2px solid black; + background: lightgray; + font: italic; +} +""" + + class SlideList(QtGui.QTableWidget): """ Customised version of QTableWidget which can respond to keyboard @@ -303,19 +313,21 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.rowCount() + 1) item = QtGui.QTableWidgetItem() label = QtGui.QLabel() - label.setMargin(8) + label.setMargin(4) #It is a Image if frame[u'text'] is None: pixmap = self.parent.RenderManager.resize_image(frame[u'image']) label.setScaledContents(True) label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) + slide_height = self.settingsmanager.slidecontroller_image * \ + self.parent.RenderManager.screen_ratio else: label.setText(frame[u'text']) + slide_height = label.sizeHint().height() self.PreviewListWidget.setCellWidget(framenumber, 0, label) self.PreviewListWidget.setItem(framenumber, 0, item) - slide_height = self.settingsmanager.slidecontroller_image * \ - self.parent.RenderManager.screen_ratio self.PreviewListWidget.setRowHeight(framenumber, slide_height) + self.PreviewListWidget.setStyleSheet(label_stylesheet) self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) if slideno > self.PreviewListWidget.rowCount(): From 791b38e0ef5adb662ca6f16ded0b09fd1f9d5614 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 20 Oct 2009 18:01:12 +0100 Subject: [PATCH 06/13] SlideControler UI fixes - take 2 --- openlp/core/ui/slidecontroller.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 47ffefcbb..0a0118537 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,9 +31,8 @@ from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType label_stylesheet = u""" QTableWidget::item:selected { - border: 2px solid black; + border: 1px solid black; background: lightgray; - font: italic; } """ From 44e57316f23cbbf1ed98644bbf910acf4746f606 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 20 Oct 2009 18:15:37 +0100 Subject: [PATCH 07/13] SlideControler UI fixes - take 3 --- openlp/core/ui/slidecontroller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 0a0118537..47f8e6bc3 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,8 +31,8 @@ from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType label_stylesheet = u""" QTableWidget::item:selected { - border: 1px solid black; - background: lightgray; + border: solid 20px pallette(dark); + color: palette(highlighted-text) } """ @@ -322,6 +322,7 @@ class SlideController(QtGui.QWidget): self.parent.RenderManager.screen_ratio else: label.setText(frame[u'text']) + label.setAlignment(QtCore.Qt.AlignHCenter) slide_height = label.sizeHint().height() self.PreviewListWidget.setCellWidget(framenumber, 0, label) self.PreviewListWidget.setItem(framenumber, 0, item) From 8c3370d803b28c00a5f14e5b87dc83bcc0d798e4 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 20 Oct 2009 19:28:34 +0200 Subject: [PATCH 08/13] Fixed up the styling on selected items in the slide controllers. --- openlp/core/ui/slidecontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 47f8e6bc3..cd0c2f5de 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,8 +31,8 @@ from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType label_stylesheet = u""" QTableWidget::item:selected { - border: solid 20px pallette(dark); - color: palette(highlighted-text) + background-color: palette(highlight); + color: palette(highlighted-text); } """ From ee6465d8a510a089b5d22c9586c4f87437027e13 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 20 Oct 2009 21:41:15 +0200 Subject: [PATCH 09/13] Made highlight colour slightly lighter/darker than background. --- openlp/core/ui/slidecontroller.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index cd0c2f5de..4f7163ba0 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -31,8 +31,7 @@ from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType label_stylesheet = u""" QTableWidget::item:selected { - background-color: palette(highlight); - color: palette(highlighted-text); + background-color: %s; } """ @@ -45,6 +44,12 @@ class SlideList(QtGui.QTableWidget): def __init__(self, parent=None, name=None): QtGui.QTableWidget.__init__(self, parent.Controller) self.parent = parent + text_color = QtGui.QApplication.palette().color(QtGui.QPalette.Base) + if text_color.value() > 128: + text_color = text_color.darker(120).name() + else: + text_color = text_color.lighter(120).name() + self.setStyleSheet(label_stylesheet % text_color) def keyPressEvent(self, event): if type(event) == QtGui.QKeyEvent: @@ -327,7 +332,6 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.setCellWidget(framenumber, 0, label) self.PreviewListWidget.setItem(framenumber, 0, item) self.PreviewListWidget.setRowHeight(framenumber, slide_height) - self.PreviewListWidget.setStyleSheet(label_stylesheet) self.PreviewListWidget.setColumnWidth( 0, self.PreviewListWidget.viewport().size().width()) if slideno > self.PreviewListWidget.rowCount(): From 20ca8340b9c58eb73b65ca86d83008beeee126c2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 21 Oct 2009 17:54:59 +0100 Subject: [PATCH 10/13] Fix up bible plugin so it works again --- openlp/plugins/bibles/lib/mediaitem.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 48ada6025..548928397 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -89,9 +89,9 @@ class BibleMediaItem(MediaManagerItem): self.QuickVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickVersionComboBox.setObjectName(u'VersionComboBox') self.QuickLayout.addWidget(self.QuickVersionComboBox, 0, 1, 1, 2) - self.QuickDualVersionLabel = QtGui.QLabel(self.QuickTab) - self.QuickDualVersionLabel.setObjectName(u'QuickDualVersionLabel') - self.QuickLayout.addWidget(self.QuickDualVersionLabel, 1, 0, 1, 1) + self.QuickSecondVersionLabel = QtGui.QLabel(self.QuickTab) + self.QuickSecondVersionLabel.setObjectName(u'QuickSecondVersionLabel') + self.QuickLayout.addWidget(self.QuickSecondVersionLabel, 1, 0, 1, 1) self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab) self.QuickSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickSecondBibleComboBox.setObjectName(u'SecondBible') @@ -127,7 +127,7 @@ class BibleMediaItem(MediaManagerItem): self.QuickLayout.addLayout(self.QuickSearchButtonLayout, 5, 0, 1, 3) self.QuickMessage = QtGui.QLabel(self.QuickTab) self.QuickMessage.setObjectName(u'QuickMessage') - self.QuickLayout.addWidget(self.QuickMessage, 5, 0, 1, 3) + self.QuickLayout.addWidget(self.QuickMessage, 6, 0, 1, 3) self.SearchTabWidget.addTab(self.QuickTab, 'Quick') QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) @@ -203,7 +203,7 @@ class BibleMediaItem(MediaManagerItem): self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton') self.AdvancedSearchButtonLayout.addWidget(self.AdvancedSearchButton) self.AdvancedLayout.addLayout(self.AdvancedSearchButtonLayout, 7, 0, 1, 3) - self.AdvancedMessage = QtGui.QLabel(self.QuickTab) + self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') @@ -231,18 +231,22 @@ class BibleMediaItem(MediaManagerItem): def configUpdated(self): if str_to_bool( self.parent.config.get_config(u'dual bibles', u'False')): + self.AdvancedSecondBibleLabel.setVisible(True) self.AdvancedSecondBibleComboBox.setVisible(True) + self.QuickSecondVersionLabel.setVisible(True) self.QuickSecondBibleComboBox.setVisible(True) else: + self.AdvancedSecondBibleLabel.setVisible(False) self.AdvancedSecondBibleComboBox.setVisible(False) + self.QuickSecondVersionLabel.setVisible(False) self.QuickSecondBibleComboBox.setVisible(False) def retranslateUi(self): log.debug(u'retranslateUi') self.QuickVersionLabel.setText( translate(u'BibleMediaItem', u'Version:')) - self.QuickDualVersionLabel.setText( - translate(u'BibleMediaItem', u'Dual:')) + self.QuickSecondVersionLabel.setText( + translate(u'BibleMediaItem', u'Dual:')) self.QuickSearchLabel.setText( translate(u'BibleMediaItem', u'Search Type:')) self.QuickSearchLabel.setText(translate(u'BibleMediaItem', u'Find:')) From 979ba02b02078cdf0a38d07d54fb493b6e8e49a5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 22 Oct 2009 20:03:08 +0100 Subject: [PATCH 11/13] Add Lines per slide and wrap indentation --- openlp/core/lib/renderer.py | 4 +++ openlp/core/lib/themexmlhandler.py | 10 +++++- openlp/core/ui/amendthemedialog.py | 26 +++++++++++---- openlp/core/ui/amendthemeform.py | 27 ++++++++++++++- openlp/core/ui/thememanager.py | 1 + resources/forms/amendthemedialog.ui | 51 +++++++++++++++++++---------- 6 files changed, 94 insertions(+), 25 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 572d96ade..91a95cddc 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -173,6 +173,7 @@ class Renderer(object): page = [] split_lines = [] for line in text: + split = False #Must be a blank line so keep it. if len(line) == 0: line = u' ' @@ -196,6 +197,9 @@ class Renderer(object): split_text = line[:pos] split_lines.append(split_text) line = line[pos:] + if len(line) > 0 : + line = u'%s%s' % \ + (u' '[:self._theme.font_main_indentation], line) #Text fits in a line now for line in split_lines: page.append(line) diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 10f2d857a..908ea7ebf 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -51,6 +51,7 @@ blankthemexml=\ 30 Normal False + 0 @@ -59,6 +60,7 @@ blankthemexml=\ 12 Normal False + 0 @@ -167,7 +169,7 @@ class ThemeXML(object): self.child_element(background, u'filename', filename) def add_font(self, name, color, proportion, override, fonttype=u'main', - weight=u'Normal', italics=u'False', xpos=0, ypos=0, width=0, height=0): + weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0, width=0, height=0): """ Add a Font. @@ -192,6 +194,9 @@ class ThemeXML(object): ``italics`` Does the font render to italics Defaults to 0 Normal + ``indentation`` + Number of characters the wrap line is indented + ``xpos`` The X position of the text block. @@ -217,6 +222,9 @@ class ThemeXML(object): self.child_element(background, u'weight', weight) #Create italics name element self.child_element(background, u'italics', italics) + #Create indentation name element + self.child_element(background, u'indentation', unicode(indentation)) + #Create Location element element = self.theme_xml.createElement(u'location') element.setAttribute(u'override',override) diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 63ffea5d8..4b99b6969 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -177,6 +177,16 @@ class Ui_AmendThemeDialog(object): self.FontMainWeightLabel.setObjectName("FontMainWeightLabel") self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) self.MainLeftLayout.addWidget(self.FontMainGroupBox) + self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel") + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel) + self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) + self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox") + self.FontMainLineSpacingSpinBox.setMaximum(10) + self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox) + self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel") + self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.MainLeftLayout.addItem(spacerItem1) self.FontMainLayout.addWidget(self.MainLeftWidget) @@ -528,7 +538,9 @@ class Ui_AmendThemeDialog(object): AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainWeightComboBox) + AmendThemeDialog.setTabOrder(self.FontMainWeightComboBox, self.FontMainLineSpacingSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainLineSpacingSpinBox, self.FontMainDefaultCheckBox) AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) @@ -536,7 +548,8 @@ class Ui_AmendThemeDialog(object): AmendThemeDialog.setTabOrder(self.FontMainHeightSpinBox, self.FontFooterComboBox) AmendThemeDialog.setTabOrder(self.FontFooterComboBox, self.FontFooterColorPushButton) AmendThemeDialog.setTabOrder(self.FontFooterColorPushButton, self.FontFooterSizeSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterWeightComboBox) + AmendThemeDialog.setTabOrder(self.FontFooterWeightComboBox, self.FontFooterDefaultCheckBox) AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) @@ -571,10 +584,11 @@ class Ui_AmendThemeDialog(object): self.FontMainColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:')) self.FontMainSize.setText(translate(u'AmendThemeDialog', u'Size:')) self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt')) - self.FontMainWeightComboBox.setItemText(0, translate("AmendThemeDialog", u'Normal')) - self.FontMainWeightComboBox.setItemText(1, translate("AmendThemeDialog", u'Bold')) - self.FontMainWeightComboBox.setItemText(2, translate("AmendThemeDialog", u'Italics')) - self.FontMainWeightComboBox.setItemText(3, translate("AmendThemeDialog", u'Bold/Italics')) + self.FontMainWrapIndentationLabel.setText(translate(u'AmendThemeDialog', u'Wrap Indentation')) + self.FontMainWeightComboBox.setItemText(0, translate(u'AmendThemeDialog', u'Normal')) + self.FontMainWeightComboBox.setItemText(1, translate(u'AmendThemeDialog', u'Bold')) + self.FontMainWeightComboBox.setItemText(2, translate(u'AmendThemeDialog', u'Italics')) + self.FontMainWeightComboBox.setItemText(3, translate(u'AmendThemeDialog', u'Bold/Italics')) self.FontMainWeightLabel.setText(translate("AmendThemeDialog", u'Font Weight:')) self.MainLocationGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location')) self.DefaultLocationLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:')) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 8ff978b68..af039852e 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -100,6 +100,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtCore.QObject.connect(self.FontMainHeightSpinBox, QtCore.SIGNAL(u'editingFinished()'), self.onFontMainHeightSpinBoxChanged) + QtCore.QObject.connect(self.FontMainLineSpacingSpinBox, + QtCore.SIGNAL(u'editingFinished()'), + self.onFontMainLineSpacingSpinBoxChanged) QtCore.QObject.connect(self.FontFooterDefaultCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onFontFooterDefaultCheckBoxChanged) @@ -150,6 +153,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): unicode(self.theme.font_main_override), u'main', unicode(self.theme.font_main_weight), unicode(self.theme.font_main_italics), + unicode(self.theme.font_main_indentation), unicode(self.theme.font_main_x), unicode(self.theme.font_main_y), unicode(self.theme.font_main_width), @@ -160,6 +164,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): unicode(self.theme.font_footer_override), u'footer', unicode(self.theme.font_footer_weight), unicode(self.theme.font_footer_italics), + 0, unicode(self.theme.font_footer_x), unicode(self.theme.font_footer_y), unicode(self.theme.font_footer_width), @@ -187,6 +192,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.parse(xml) self.theme.extend_image_filename(self.path) self.thememanager.cleanTheme(self.theme) + # Stop the initial screen setup generating 1 preview per field! self.allowPreview = False self.paintUi(self.theme) self.allowPreview = True @@ -252,6 +258,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) self.FontMainHeightSpinBox.setValue(int( \ self.theme.font_main_height)) + self.FontMainLineSpacingSpinBox.setValue(int( \ + self.theme.font_main_indentation)) self.stateChanging(self.theme) self.previewTheme(self.theme) @@ -270,6 +278,11 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.font_main_width = self.FontMainWidthSpinBox.value() self.previewTheme(self.theme) + def onFontMainLineSpacingSpinBoxChanged(self): + if self.theme.font_main_indentation != self.FontMainLineSpacingSpinBox.value(): + self.theme.font_main_indentation = self.FontMainLineSpacingSpinBox.value() + self.previewTheme(self.theme) + def onFontMainHeightSpinBoxChanged(self): if self.theme.font_main_height != self.FontMainHeightSpinBox.value(): self.theme.font_main_height = self.FontMainHeightSpinBox.value() @@ -498,7 +511,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainWeightComboBox.setCurrentIndex(2) else: self.FontMainWeightComboBox.setCurrentIndex(3) - + self.FontMainLineSpacingSpinBox.setValue(int(self.theme.font_main_indentation)) self.FontMainXSpinBox.setValue(int(self.theme.font_main_x)) self.FontMainYSpinBox.setValue(int(self.theme.font_main_y)) self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) @@ -653,5 +666,17 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def previewTheme(self, theme): if self.allowPreview: + #calculate main number of rows + main_weight = 50 + if self.theme.font_main_weight == u'Bold': + main_weight = 75 + mainFont = QtGui.QFont(self.theme.font_main_name, + int(self.theme.font_main_proportion), # size + int(main_weight), # weight + self.theme.font_main_italics)# italic + metrics = QtGui.QFontMetrics(mainFont) + page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2 ) - 1 + self.FontMainLinesPageLabel.setText( + translate(u'ThemeManager', u'Slide Height is %s rows' % page_length )) frame = self.thememanager.generateImage(theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 50e433534..84f88c726 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -510,6 +510,7 @@ class ThemeManager(QtGui.QWidget): theme.font_main_color = theme.font_main_color.strip() theme.font_main_height = theme.font_main_height.strip() theme.font_main_italics = str_to_bool(theme.font_main_italics) + theme.font_main_indentation = int(theme.font_main_indentation) theme.font_main_name = theme.font_main_name.strip() #theme.font_main_override theme.font_main_proportion = theme.font_main_proportion.strip() diff --git a/resources/forms/amendthemedialog.ui b/resources/forms/amendthemedialog.ui index 84fa8b7bd..90ed34cc5 100644 --- a/resources/forms/amendthemedialog.ui +++ b/resources/forms/amendthemedialog.ui @@ -17,7 +17,7 @@ Theme Maintance - + :/icon/openlp.org-icon-32.bmp:/icon/openlp.org-icon-32.bmp @@ -64,7 +64,7 @@ - 0 + 2 @@ -312,15 +312,32 @@ 0 - - 16 - pt 999 + + 16 + + + + + + + Wrap Indentation + + + + + + + + + + TextLabel + @@ -425,15 +442,15 @@ 0 - - 0 - px 9999 + + 0 + @@ -609,15 +626,15 @@ 0 - - 10 - pt 999 + + 10 + @@ -728,15 +745,15 @@ 0 - - 0 - px 9999 + + 0 + @@ -753,15 +770,15 @@ 0 - - 0 - px 9999 + + 0 + From 67ab01df01a9c4d5573bd76fa82afd31cce1c5b9 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 22 Oct 2009 20:07:32 +0100 Subject: [PATCH 12/13] Minor corrections --- openlp/core/lib/renderer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 91a95cddc..2e3180860 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -173,7 +173,6 @@ class Renderer(object): page = [] split_lines = [] for line in text: - split = False #Must be a blank line so keep it. if len(line) == 0: line = u' ' @@ -197,6 +196,7 @@ class Renderer(object): split_text = line[:pos] split_lines.append(split_text) line = line[pos:] + #if we have more text add up to 10 spaces on the front. if len(line) > 0 : line = u'%s%s' % \ (u' '[:self._theme.font_main_indentation], line) From 6c5ccc101b3c8e66040b3569df73a223faa1e42d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 23 Oct 2009 17:10:09 +0100 Subject: [PATCH 13/13] Font Siziing and rendering improvements --- openlp/core/lib/renderer.py | 12 ++++++++---- openlp/core/lib/themexmlhandler.py | 4 ++-- openlp/core/ui/amendthemeform.py | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 2e3180860..4f6aa9235 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -169,6 +169,8 @@ class Renderer(object): page_length = int(self._rect.height() / metrics.height() - 2 ) - 1 ave_line_width = line_width / metrics.averageCharWidth() ave_line_width = int(ave_line_width + (ave_line_width * 1)) + log.debug(u'Page Length area height %s , metrics %s , lines %s' % + (int(self._rect.height()), metrics.height(), page_length )) split_pages = [] page = [] split_lines = [] @@ -195,15 +197,17 @@ class Renderer(object): else: split_text = line[:pos] split_lines.append(split_text) - line = line[pos:] + line = line[pos:].lstrip() #if we have more text add up to 10 spaces on the front. - if len(line) > 0 : + if len(line) > 0 and self._theme.font_main_indentation > 0: line = u'%s%s' % \ (u' '[:self._theme.font_main_indentation], line) #Text fits in a line now - for line in split_lines: + for count, line in enumerate(split_lines): page.append(line) - if len(page) == page_length: + #last but one line and only 2 lines to go or end of page + if (len(page) == page_length - 1 and len(split_lines) - 3 == count) or \ + len(page) == page_length: split_pages.append(page) page = [] if len(page) > 0 and page != u' ': diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index 908ea7ebf..7aab3bf7a 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -52,7 +52,7 @@ blankthemexml=\ Normal False 0 - + Arial @@ -61,7 +61,7 @@ blankthemexml=\ Normal False 0 - + True diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index af039852e..d2afd2fcb 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -674,8 +674,11 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): int(self.theme.font_main_proportion), # size int(main_weight), # weight self.theme.font_main_italics)# italic + mainFont.setPixelSize(int(self.theme.font_main_proportion)) metrics = QtGui.QFontMetrics(mainFont) page_length = (int(self.FontMainHeightSpinBox.value()) / metrics.height() - 2 ) - 1 + log.debug(u'Page Length area height %s , metrics %s , lines %s' % + (int(self.FontMainHeightSpinBox.value()), metrics.height(), page_length )) self.FontMainLinesPageLabel.setText( translate(u'ThemeManager', u'Slide Height is %s rows' % page_length )) frame = self.thememanager.generateImage(theme)