diff --git a/openlp.pyw b/openlp.pyw index f3455962d..a1a616462 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -182,7 +182,7 @@ class OpenLP(QtGui.QApplication): screens = ScreenList() # Decide how many screens we have and their size for screen in xrange(0, self.desktop().numScreens()): - size = self.desktop().screenGeometry(screen); + size = self.desktop().screenGeometry(screen) screens.add_screen({u'number': screen, u'size': size, u'primary': (self.desktop().primaryScreen() == screen)}) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ebbe31597..ec8cf739c 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -102,7 +102,8 @@ def translate(context, text, comment=None, An identifying string for when the same text is used in different roles within the same context. """ - return QtCore.QCoreApplication.translate(context, text, comment, encoding, n) + return QtCore.QCoreApplication.translate( + context, text, comment, encoding, n) def get_text_file_string(text_file): """ diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/lib/dockwidget.py index 9c4187337..24841ec33 100644 --- a/openlp/core/lib/dockwidget.py +++ b/openlp/core/lib/dockwidget.py @@ -48,4 +48,3 @@ class OpenLPDockWidget(QtGui.QDockWidget): self.setObjectName(name) if icon: self.setWindowIcon(icon) - self.setFloating(False) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index a9484795b..2d6bcce46 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -111,7 +111,7 @@ class MediaManagerItem(QtGui.QWidget): self.singleServiceItem = True self.pageLayout = QtGui.QVBoxLayout(self) self.pageLayout.setSpacing(0) - self.pageLayout.setContentsMargins(4, 0, 4, 0) + self.pageLayout.setMargin(0) self.requiredIcons() self.setupUi() self.retranslateUi() @@ -176,7 +176,8 @@ class MediaManagerItem(QtGui.QWidget): # break compatability), but it makes sense for the icon to # come before the tooltip (as you have to have an icon, but # not neccesarily a tooltip) - self.toolbar.addToolbarButton(title, icon, tooltip, slot, checkable) + return self.toolbar.addToolbarButton(title, icon, tooltip, slot, + checkable) def addToolbarSeparator(self): """ @@ -268,7 +269,6 @@ class MediaManagerItem(QtGui.QWidget): #Add the List widget self.listView = self.ListViewWithDnD_class(self) self.listView.uniformItemSizes = True - self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591)) self.listView.setSpacing(1) self.listView.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) diff --git a/openlp/core/lib/searchedit.py b/openlp/core/lib/searchedit.py index 738661e14..c69e1f15b 100644 --- a/openlp/core/lib/searchedit.py +++ b/openlp/core/lib/searchedit.py @@ -69,7 +69,7 @@ class SearchEdit(QtGui.QLineEdit): """ frameWidth = self.style().pixelMetric( QtGui.QStyle.PM_DefaultFrameWidth) - rightPadding = self.clearButton.sizeHint().width() + frameWidth + rightPadding = self.clearButton.width() + frameWidth if hasattr(self, u'menuButton'): leftPadding = self.menuButton.width() self.setStyleSheet( @@ -78,10 +78,10 @@ class SearchEdit(QtGui.QLineEdit): else: self.setStyleSheet(u'QLineEdit { padding-right: %spx; } ' % \ rightPadding) - msz = self.minimumSizeHint(); + msz = self.minimumSizeHint() self.setMinimumSize( max(msz.width(), - self.clearButton.sizeHint().width() + (frameWidth * 2) + 2), + self.clearButton.width() + (frameWidth * 2) + 2), max(msz.height(), self.clearButton.height() + (frameWidth * 2) + 2) ) @@ -93,13 +93,13 @@ class SearchEdit(QtGui.QLineEdit): ``event`` The event that happened. """ - sz = self.clearButton.sizeHint() + sz = self.clearButton.size() frameWidth = self.style().pixelMetric( QtGui.QStyle.PM_DefaultFrameWidth) self.clearButton.move(self.rect().right() - frameWidth - sz.width(), (self.rect().bottom() + 1 - sz.height()) / 2) if hasattr(self, u'menuButton'): - sz = self.menuButton.sizeHint() + sz = self.menuButton.size() self.menuButton.move(self.rect().left() + frameWidth + 2, (self.rect().bottom() + 1 - sz.height()) / 2) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 6586a50f2..5081d9769 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -55,7 +55,34 @@ class SettingsTab(QtGui.QWidget): """ Setup the tab's interface. """ - pass + self.tabLayout = QtGui.QHBoxLayout(self) + self.tabLayout.setObjectName(u'tabLayout') + self.leftColumn = QtGui.QWidget(self) + self.leftColumn.setObjectName(u'leftColumn') + self.leftLayout = QtGui.QVBoxLayout(self.leftColumn) + self.leftLayout.setMargin(0) + self.leftLayout.setObjectName(u'leftLayout') + self.tabLayout.addWidget(self.leftColumn) + self.rightColumn = QtGui.QWidget(self) + self.rightColumn.setObjectName(u'rightColumn') + self.rightLayout = QtGui.QVBoxLayout(self.rightColumn) + self.rightLayout.setMargin(0) + self.rightLayout.setObjectName(u'rightLayout') + self.tabLayout.addWidget(self.rightColumn) + + def resizeEvent(self, event=None): + """ + Resize the sides in two equal halves if the layout allows this. + """ + if event: + QtGui.QWidget.resizeEvent(self, event) + width = self.width() - self.tabLayout.spacing() - \ + self.tabLayout.contentsMargins().left() - \ + self.tabLayout.contentsMargins().right() + left_width = min(width - self.rightColumn.minimumSizeHint().width(), + width / 2) + left_width = max(left_width, self.leftColumn.minimumSizeHint().width()) + self.leftColumn.setFixedWidth(left_width) def preLoad(self): """ diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index e37dc6f22..93aed62e5 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -72,27 +72,27 @@ class OpenLPToolbar(QtGui.QToolBar): ``objectname`` The name of the object, as used in `