This commit is contained in:
rimach 2010-09-07 23:04:13 +02:00
commit 8bdedae911
5 changed files with 23 additions and 15 deletions

View File

@ -145,6 +145,7 @@ body {
}
document.getElementById('black').style.display = black;
document.getElementById('lyricsmain').style.visibility = lyrics;
document.getElementById('image').style.visibility = lyrics;
outline = document.getElementById('lyricsoutline')
if(outline!=null)
outline.style.visibility = lyrics;
@ -327,7 +328,7 @@ def build_background_css(item, width, height):
else:
background = \
u'background: -webkit-gradient(radial, %s 50%%, 100, %s ' \
u'50%%, %s, from(%s), to(%s))' % (width, width, width,
u'50%%, %s, from(%s), to(%s))' % (width, width, width,
theme.background_startColor, theme.background_endColor)
return background
@ -370,10 +371,10 @@ def build_lyrics_css(item, webkitvers):
lyricsmain = u''
outline = u''
shadow = u''
if theme:
if theme and item.main:
lyricstable = u'left: %spx; top: %spx;' % \
(item.main.x(), item.main.y())
lyrics = build_lyrics_format_css(theme, item.main.width(),
lyrics = build_lyrics_format_css(theme, item.main.width(),
item.main.height())
# For performance reasons we want to show as few DIV's as possible,
# especially when animating/transitions.
@ -393,7 +394,7 @@ def build_lyrics_css(item, webkitvers):
if webkitvers >= 533.3:
lyricsmain += build_lyrics_outline_css(theme)
else:
outline = build_lyrics_outline_css(theme)
outline = build_lyrics_outline_css(theme)
if theme.display_shadow:
if theme.display_outline and webkitvers < 534.3:
shadow = u'padding-left: %spx; padding-top: %spx ' % \
@ -405,7 +406,7 @@ def build_lyrics_css(item, webkitvers):
theme.display_shadow_size)
lyrics_css = style % (lyricstable, lyrics, lyricsmain, outline, shadow)
return lyrics_css
def build_lyrics_outline_css(theme, is_shadow=False):
"""
Build the css which controls the theme outline
@ -413,7 +414,7 @@ def build_lyrics_outline_css(theme, is_shadow=False):
`theme`
Object containing theme information
`is_shadow`
If true, use the shadow colors instead
"""
@ -437,7 +438,7 @@ def build_lyrics_format_css(theme, width, height):
`theme`
Object containing theme information
`width`
Width of the lyrics block
@ -461,8 +462,8 @@ def build_lyrics_format_css(theme, width, height):
'text-align: %s; vertical-align: %s; font-family: %s; ' \
'font-size: %spt; color: %s; line-height: %d%%; ' \
'margin:0; padding:0; width: %spx; height: %spx; ' % \
(align, valign, theme.font_main_name, theme.font_main_proportion,
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
(align, valign, theme.font_main_name, theme.font_main_proportion,
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
width, height)
if theme.display_outline:
if webkit_version() < 534.3:
@ -472,7 +473,7 @@ def build_lyrics_format_css(theme, width, height):
if theme.font_main_weight == u'Bold':
lyrics += u' font-weight:bold; '
return lyrics
def build_lyrics_html(item, webkitvers):
"""
Build the HTML required to show the lyrics
@ -520,7 +521,7 @@ def build_footer_css(item):
text-align: %s;
"""
theme = item.themedata
if not theme:
if not theme or not item.footer:
return u''
if theme.display_horizontalAlign == 2:
align = u'center'

View File

@ -93,6 +93,8 @@ class RenderManager(object):
"""
self.global_theme = global_theme
self.theme_level = theme_level
self.global_theme_data = \
self.theme_manager.getThemeData(self.global_theme)
self.themedata = None
def set_service_theme(self, service_theme):

View File

@ -170,6 +170,7 @@ class ServiceItem(object):
u'verseTag': slide[u'verseTag'] })
log.log(15, u'Formatting took %4s' % (time.time() - before))
elif self.service_item_type == ServiceItemType.Image:
self.themedata = self.render_manager.global_theme_data
for slide in self._raw_frames:
slide[u'image'] = resize_image(slide[u'image'],
self.render_manager.width, self.render_manager.height)

View File

@ -97,6 +97,7 @@ class MainDisplay(DisplayWidget):
self.screens = screens
self.isLive = live
self.alertTab = None
self.hide_mode = None
self.setWindowTitle(u'OpenLP Display')
self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
QtCore.Qt.WindowStaysOnTopHint)
@ -340,6 +341,9 @@ class MainDisplay(DisplayWidget):
self.webView.setHtml(html)
if serviceItem.foot_text and serviceItem.foot_text:
self.footer(serviceItem.foot_text)
# if was hidden keep it hidden
if self.hide_mode and self.isLive:
self.hideDisplay(self.hide_mode)
def footer(self, text):
"""
@ -365,6 +369,7 @@ class MainDisplay(DisplayWidget):
self.frame.evaluateJavaScript(u'show_blank("theme");')
if mode != HideMode.Screen and self.isHidden():
self.setVisible(True)
self.hide_mode = mode
def showDisplay(self):
"""
@ -378,6 +383,7 @@ class MainDisplay(DisplayWidget):
self.setVisible(True)
# Trigger actions when display is active again
Receiver.send_message(u'maindisplay_active')
self.hide_mode = None
class AudioPlayer(QtCore.QObject):
"""

View File

@ -274,7 +274,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
item = self.VerseListWidget.item(row, 0)
data = unicode(item.data(QtCore.Qt.UserRole).toString())
bit = data.split(u':')
rowTag = u'%s\n%s' % (bit[0][0:1], bit[1])
rowTag = u'%s%s' % (bit[0][0:1], bit[1])
rowLabel.append(rowTag)
self.VerseListWidget.setVerticalHeaderLabels(rowLabel)
@ -395,9 +395,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.VerseDeleteButton.setEnabled(True)
def onVerseAddButtonClicked(self):
# Allow insert button as you do not know if multiple verses will
# be entered.
self.verse_form.setVerse(u'')
self.verse_form.setVerse(u'', True)
if self.verse_form.exec_():
afterText, verse, subVerse = self.verse_form.getVerse()
data = u'%s:%s' % (verse, subVerse)