Alignment fix for SearchEdit

This commit is contained in:
M2j 2011-01-05 11:48:47 +01:00
parent 21340470d3
commit 92ed275add
3 changed files with 10 additions and 8 deletions

View File

@ -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(
@ -81,7 +81,7 @@ class SearchEdit(QtGui.QLineEdit):
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)

View File

@ -65,11 +65,12 @@ class Ui_EditSongDialog(object):
QtCore.Qt.AlignTop)
self.verseListWidget = QtGui.QTableWidget(self.lyricsTab)
self.verseListWidget.horizontalHeader().setVisible(False)
self.verseListWidget.setAlternatingRowColors(True)
self.verseListWidget.setColumnCount(1)
self.verseListWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.verseListWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
self.verseListWidget.setAlternatingRowColors(True)
self.verseListWidget.setObjectName(u'verseListWidget')
self.lyricsLabel.setBuddy(self.verseListWidget)
self.lyricsTabLayout.addWidget(self.verseListWidget, 2, 1)
@ -233,7 +234,7 @@ class Ui_EditSongDialog(object):
self.copyrightInsertButton.setObjectName(u'copyrightInsertButton')
self.copyrightLayout.addWidget(self.copyrightInsertButton)
self.rightsLayout.addLayout(self.copyrightLayout)
self.CCLILayout = QtGui.QVBoxLayout()
self.CCLILayout = QtGui.QHBoxLayout()
self.CCLILayout.setObjectName(u'CCLILayout')
self.CCLILabel = QtGui.QLabel(self.rightsGroupBox)
self.CCLILabel.setObjectName(u'CCLILabel')

View File

@ -603,10 +603,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onCopyrightInsertButtonTriggered(self):
text = self.copyrightEdit.text()
pos = self.copyrightEdit.cursorPosition()
text = text[:pos] + '\xa9' + text[pos:]
sign = translate('SongsPlugin.EditSongForm', '\xa9')
text = text[:pos] + sign + text[pos:]
self.copyrightEdit.setText(text)
self.copyrightEdit.setFocus()
self.copyrightEdit.setCursorPosition(pos + 1)
self.copyrightEdit.setCursorPosition(pos + len(sign))
def onMaintenanceButtonClicked(self):
temp_song_book = None