1
0
mirror of https://gitlab.com/openlp/openlp.git synced 2024-09-28 10:57:36 +00:00

Fix up theme bugs

This commit is contained in:
Tim Bentley 2010-03-26 20:48:46 +00:00
parent 92e90b91e5
commit 35255c250e
2 changed files with 6 additions and 14 deletions

View File

@ -466,8 +466,7 @@ class Renderer(object):
tlcorner=(x + display_shadow_size, y + display_shadow_size),
draw=True, color = self._theme.display_shadow_color)
self._get_extent_and_render(line, footer, tlcorner=(x, y), draw=True,
outline_size=display_outline_size,
outline_color=self._theme.display_outline_color)
outline_size=display_outline_size)
y += h
if linenum == 0:
self._first_line_right_extent = rightextent
@ -505,7 +504,7 @@ class Renderer(object):
self.mainFont.setPixelSize(self._theme.font_main_proportion)
def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False,
color=None, outline_size=0, outline_color=None):
color=None, outline_size=0):
"""
Find bounding box of text - as render_single_line. If draw is set,
actually draw the text to the current DC as well return width and
@ -544,7 +543,7 @@ class Renderer(object):
else:
pen = QtGui.QColor(color)
x, y = tlcorner
if self._theme.display_outline:
if self._theme.display_outline and outline_size != 0:
path = QtGui.QPainterPath()
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
self.painter.setBrush(self.painter.pen().brush())
@ -555,7 +554,7 @@ class Renderer(object):
self.painter.drawText(x, y + metrics.ascent(), line)
if self._theme.display_slideTransition:
# Print 2nd image with 70% weight
if self._theme.display_outline:
if self._theme.display_outline and outline_size != 0:
path = QtGui.QPainterPath()
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
self.painter2.setBrush(self.painter2.pen().brush())

View File

@ -393,6 +393,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.background_type = u'solid'
if self.theme.background_color is None :
self.theme.background_color = u'#000000'
self.ImageLineEdit.setText(u'')
elif background == 1: # Gradient
self.theme.background_type = u'gradient'
if gradient == 0: # Horizontal
@ -405,6 +406,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.theme.background_startColor = u'#000000'
if self.theme.background_endColor is None :
self.theme.background_endColor = u'#ff0000'
self.ImageLineEdit.setText(u'')
else:
self.theme.background_type = u'image'
self.stateChanging(self.theme)
@ -422,7 +424,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.Color1PushButton.setStyleSheet(
u'background-color: %s' % \
unicode(self.theme.background_startColor))
self.previewTheme()
def onColor2PushButtonClicked(self):
@ -561,22 +562,18 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
u'background-color: %s' % unicode(theme.font_main_color))
self.FontFooterColorPushButton.setStyleSheet(
u'background-color: %s' % unicode(theme.font_footer_color))
if not self.theme.font_main_override:
self.FontMainDefaultCheckBox.setChecked(True)
else:
self.FontMainDefaultCheckBox.setChecked(False)
if not self.theme.font_footer_override:
self.FontFooterDefaultCheckBox.setChecked(True)
else:
self.FontFooterDefaultCheckBox.setChecked(False)
self.OutlineColorPushButton.setStyleSheet(
u'background-color: %s' % unicode(theme.display_outline_color))
self.ShadowColorPushButton.setStyleSheet(
u'background-color: %s' % unicode(theme.display_shadow_color))
if self.theme.display_outline:
self.OutlineCheckBox.setChecked(True)
self.OutlineColorPushButton.setEnabled(True)
@ -584,7 +581,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.OutlineCheckBox.setChecked(False)
self.OutlineColorPushButton.setEnabled(False)
self.OutlineSpinBox.setValue(int(self.theme.display_outline_size))
if self.theme.display_shadow:
self.ShadowCheckBox.setChecked(True)
self.ShadowColorPushButton.setEnabled(True)
@ -592,12 +588,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.ShadowCheckBox.setChecked(False)
self.ShadowColorPushButton.setEnabled(False)
self.ShadowSpinBox.setValue(int(self.theme.display_shadow_size))
if self.theme.display_slideTransition:
self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Checked)
else:
self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Unchecked)
self.HorizontalComboBox.setCurrentIndex(
self.theme.display_horizontalAlign)
self.VerticalComboBox.setCurrentIndex(self.theme.display_verticalAlign)
@ -657,7 +651,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.ImageFilenameWidget.setVisible(True)
self.GradientLabel.setVisible(False)
self.GradientComboBox.setVisible(False)
if not theme.font_main_override:
self.FontMainXSpinBox.setEnabled(False)
self.FontMainYSpinBox.setEnabled(False)