Add justify to theme options

Fixes: https://launchpad.net/bugs/802252
This commit is contained in:
Tim Bentley 2011-09-16 18:23:39 +01:00
parent 31faef389a
commit 6a901f2de9
3 changed files with 11 additions and 4 deletions

View File

@ -557,11 +557,15 @@ def build_lyrics_format_css(theme, width, height):
left_margin = int(theme.font_main_outline_size) * 2
else:
left_margin = 0
lyrics = u'white-space:pre-wrap; word-wrap: break-word; ' \
justify = u'white-space:pre-wrap;'
# fix tag incompatibilities
if theme.display_horizontal_align == HorizontalType.Justify:
justify = u''
lyrics = u'%s word-wrap: break-word; ' \
'text-align: %s; vertical-align: %s; font-family: %s; ' \
'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
(align, valign, theme.font_main_name, theme.font_main_size,
(justify, align, valign, theme.font_main_name, theme.font_main_size,
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
left_margin, width, height)
if theme.font_main_outline:

View File

@ -176,8 +176,9 @@ class HorizontalType(object):
Left = 0
Right = 1
Center = 2
Justify = 3
Names = [u'left', u'right', u'center']
Names = [u'left', u'right', u'center', u'justify']
class VerticalType(object):

View File

@ -246,7 +246,7 @@ class Ui_ThemeWizard(object):
self.horizontalLabel = QtGui.QLabel(self.alignmentPage)
self.horizontalLabel.setObjectName(u'HorizontalLabel')
self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage)
self.horizontalComboBox.addItems([u'', u'', u''])
self.horizontalComboBox.addItems([u'', u'', u'', u''])
self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
self.alignmentLayout.addRow(self.horizontalLabel,
self.horizontalComboBox)
@ -495,6 +495,8 @@ class Ui_ThemeWizard(object):
translate('OpenLP.ThemeWizard', 'Right'))
self.horizontalComboBox.setItemText(HorizontalType.Center,
translate('OpenLP.ThemeWizard', 'Center'))
self.horizontalComboBox.setItemText(HorizontalType.Justify,
translate('OpenLP.ThemeWizard', 'Justify'))
self.transitionsLabel.setText(
translate('OpenLP.ThemeWizard', 'Transitions:'))
self.areaPositionPage.setTitle(