forked from openlp/openlp
Added option to wrap footer text
This commit is contained in:
parent
b2afbd688d
commit
73ec92ae13
@ -286,6 +286,7 @@ class Settings(QtCore.QSettings):
|
|||||||
'themes/last directory export': '',
|
'themes/last directory export': '',
|
||||||
'themes/last directory import': '',
|
'themes/last directory import': '',
|
||||||
'themes/theme level': ThemeLevel.Song,
|
'themes/theme level': ThemeLevel.Song,
|
||||||
|
'themes/wrap footer': False,
|
||||||
'user interface/live panel': True,
|
'user interface/live panel': True,
|
||||||
'user interface/live splitter geometry': QtCore.QByteArray(),
|
'user interface/live splitter geometry': QtCore.QByteArray(),
|
||||||
'user interface/lock panel': False,
|
'user interface/lock panel': False,
|
||||||
|
@ -398,6 +398,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtWebKit
|
from PyQt4 import QtWebKit
|
||||||
|
|
||||||
|
from openlp.core.common import Settings
|
||||||
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, VerticalType, HorizontalType
|
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, VerticalType, HorizontalType
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -750,12 +751,13 @@ def build_footer_css(item, height):
|
|||||||
font-size: %spt;
|
font-size: %spt;
|
||||||
color: %s;
|
color: %s;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
white-space: nowrap;
|
white-space: %s;
|
||||||
"""
|
"""
|
||||||
theme = item.theme_data
|
theme = item.theme_data
|
||||||
if not theme or not item.footer:
|
if not theme or not item.footer:
|
||||||
return ''
|
return ''
|
||||||
bottom = height - int(item.footer.y()) - int(item.footer.height())
|
bottom = height - int(item.footer.y()) - int(item.footer.height())
|
||||||
|
whitespace = 'normal' if Settings().value('themes/wrap footer') else 'nowrap'
|
||||||
lyrics_html = style % (item.footer.x(), bottom, item.footer.width(),
|
lyrics_html = style % (item.footer.x(), bottom, item.footer.width(),
|
||||||
theme.font_footer_name, theme.font_footer_size, theme.font_footer_color)
|
theme.font_footer_name, theme.font_footer_size, theme.font_footer_color, whitespace)
|
||||||
return lyrics_html
|
return lyrics_html
|
||||||
|
@ -69,6 +69,14 @@ class ThemesTab(SettingsTab):
|
|||||||
self.default_list_view.setObjectName('default_list_view')
|
self.default_list_view.setObjectName('default_list_view')
|
||||||
self.global_group_box_layout.addWidget(self.default_list_view)
|
self.global_group_box_layout.addWidget(self.default_list_view)
|
||||||
self.left_layout.addWidget(self.global_group_box)
|
self.left_layout.addWidget(self.global_group_box)
|
||||||
|
self.universal_group_box = QtGui.QGroupBox(self.left_column)
|
||||||
|
self.universal_group_box.setObjectName('universal_group_box')
|
||||||
|
self.universal_group_box_layout = QtGui.QVBoxLayout(self.universal_group_box)
|
||||||
|
self.universal_group_box_layout.setObjectName('universal_group_box_layout')
|
||||||
|
self.wrap_footer_check_box = QtGui.QCheckBox(self.universal_group_box)
|
||||||
|
self.wrap_footer_check_box.setObjectName('wrap_footer_check_box')
|
||||||
|
self.universal_group_box_layout.addWidget(self.wrap_footer_check_box)
|
||||||
|
self.left_layout.addWidget(self.universal_group_box)
|
||||||
self.left_layout.addStretch()
|
self.left_layout.addStretch()
|
||||||
self.level_group_box = QtGui.QGroupBox(self.right_column)
|
self.level_group_box = QtGui.QGroupBox(self.right_column)
|
||||||
self.level_group_box.setObjectName('level_group_box')
|
self.level_group_box.setObjectName('level_group_box')
|
||||||
@ -112,6 +120,8 @@ class ThemesTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
self.tab_title_visible = UiStrings().Themes
|
self.tab_title_visible = UiStrings().Themes
|
||||||
self.global_group_box.setTitle(translate('OpenLP.ThemesTab', 'Global Theme'))
|
self.global_group_box.setTitle(translate('OpenLP.ThemesTab', 'Global Theme'))
|
||||||
|
self.universal_group_box.setTitle(translate('OpenLP.ThemesTab', 'Universal Settings'))
|
||||||
|
self.wrap_footer_check_box.setText(translate('OpenLP.ThemesTab', '&Wrap footer text'))
|
||||||
self.level_group_box.setTitle(translate('OpenLP.ThemesTab', 'Theme Level'))
|
self.level_group_box.setTitle(translate('OpenLP.ThemesTab', 'Theme Level'))
|
||||||
self.song_level_radio_button.setText(translate('OpenLP.ThemesTab', 'S&ong Level'))
|
self.song_level_radio_button.setText(translate('OpenLP.ThemesTab', 'S&ong Level'))
|
||||||
self.song_level_label.setText(
|
self.song_level_label.setText(
|
||||||
@ -136,6 +146,7 @@ class ThemesTab(SettingsTab):
|
|||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settings_section)
|
||||||
self.theme_level = settings.value('theme level')
|
self.theme_level = settings.value('theme level')
|
||||||
self.global_theme = settings.value('global theme')
|
self.global_theme = settings.value('global theme')
|
||||||
|
wrap_footer = settings.value('wrap footer')
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
if self.theme_level == ThemeLevel.Global:
|
if self.theme_level == ThemeLevel.Global:
|
||||||
self.global_level_radio_button.setChecked(True)
|
self.global_level_radio_button.setChecked(True)
|
||||||
@ -143,15 +154,18 @@ class ThemesTab(SettingsTab):
|
|||||||
self.service_level_radio_button.setChecked(True)
|
self.service_level_radio_button.setChecked(True)
|
||||||
else:
|
else:
|
||||||
self.song_level_radio_button.setChecked(True)
|
self.song_level_radio_button.setChecked(True)
|
||||||
|
self.wrap_footer_check_box.setChecked(wrap_footer)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
"""
|
"""
|
||||||
Save the settings
|
Save the settings
|
||||||
"""
|
"""
|
||||||
|
wrap_footer = self.wrap_footer_check_box.isChecked()
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
settings.beginGroup(self.settings_section)
|
settings.beginGroup(self.settings_section)
|
||||||
settings.setValue('theme level', self.theme_level)
|
settings.setValue('theme level', self.theme_level)
|
||||||
settings.setValue('global theme', self.global_theme)
|
settings.setValue('global theme', self.global_theme)
|
||||||
|
settings.setValue('wrap footer', wrap_footer)
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.renderer.set_theme_level(self.theme_level)
|
self.renderer.set_theme_level(self.theme_level)
|
||||||
if self.tab_visited:
|
if self.tab_visited:
|
||||||
|
@ -374,7 +374,7 @@ def clean_song(manager, song):
|
|||||||
:param manager: The song database manager object.
|
:param manager: The song database manager object.
|
||||||
:param song: The song object.
|
:param song: The song object.
|
||||||
"""
|
"""
|
||||||
from .xml import SongXML
|
from .openlyricsxml import SongXML
|
||||||
|
|
||||||
if song.title:
|
if song.title:
|
||||||
song.title = clean_title(song.title)
|
song.title = clean_title(song.title)
|
||||||
|
Loading…
Reference in New Issue
Block a user