forked from openlp/openlp
Fix missing tails for bottom alignment
This commit is contained in:
parent
50f3f2c9b8
commit
6eff57d17b
@ -458,13 +458,18 @@ def build_lyrics_format_css(theme, width, height):
|
|||||||
# fix tag incompatibilities
|
# fix tag incompatibilities
|
||||||
if theme.display_horizontal_align == HorizontalType.Justify:
|
if theme.display_horizontal_align == HorizontalType.Justify:
|
||||||
justify = u''
|
justify = u''
|
||||||
|
if theme.display_vertical_align == VerticalType.Bottom:
|
||||||
|
padding_bottom = u'0.5em'
|
||||||
|
else:
|
||||||
|
padding_bottom = u'0'
|
||||||
lyrics = u'%s word-wrap: break-word; ' \
|
lyrics = u'%s word-wrap: break-word; ' \
|
||||||
'text-align: %s; vertical-align: %s; font-family: %s; ' \
|
'text-align: %s; vertical-align: %s; font-family: %s; ' \
|
||||||
'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
|
'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
|
||||||
'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
|
'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx;' \
|
||||||
|
'height: %spx; ' % \
|
||||||
(justify, 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),
|
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
|
||||||
left_margin, width, height)
|
padding_bottom, left_margin, width, height)
|
||||||
if theme.font_main_outline:
|
if theme.font_main_outline:
|
||||||
if webkit_version() <= 534.3:
|
if webkit_version() <= 534.3:
|
||||||
lyrics += u' letter-spacing: 1px;'
|
lyrics += u' letter-spacing: 1px;'
|
||||||
|
@ -289,7 +289,7 @@ class Renderer(object):
|
|||||||
|
|
||||||
def _calculate_default(self):
|
def _calculate_default(self):
|
||||||
"""
|
"""
|
||||||
Calculate the default dimentions of the screen.
|
Calculate the default dimensions of the screen.
|
||||||
"""
|
"""
|
||||||
screen_size = self.screens.current[u'size']
|
screen_size = self.screens.current[u'size']
|
||||||
self.width = screen_size.width()
|
self.width = screen_size.width()
|
||||||
@ -380,6 +380,7 @@ class Renderer(object):
|
|||||||
(build_lyrics_format_css(self.theme_data, self.page_width,
|
(build_lyrics_format_css(self.theme_data, self.page_width,
|
||||||
self.page_height), build_lyrics_outline_css(self.theme_data))
|
self.page_height), build_lyrics_outline_css(self.theme_data))
|
||||||
self.web.setHtml(html)
|
self.web.setHtml(html)
|
||||||
|
self.empty_height = self.web_frame.contentsSize().height()
|
||||||
|
|
||||||
def _paginate_slide(self, lines, line_end):
|
def _paginate_slide(self, lines, line_end):
|
||||||
"""
|
"""
|
||||||
@ -600,7 +601,7 @@ class Renderer(object):
|
|||||||
"""
|
"""
|
||||||
self.web_frame.evaluateJavaScript(u'show_text("%s")' %
|
self.web_frame.evaluateJavaScript(u'show_text("%s")' %
|
||||||
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||||
return self.web_frame.contentsSize().height() <= self.page_height
|
return self.web_frame.contentsSize().height() <= self.empty_height
|
||||||
|
|
||||||
def _words_split(self, line):
|
def _words_split(self, line):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user