Add screen list to General Tab

Add new Font bits to XML code
Add guards to renderer incase of no second text area
This commit is contained in:
Tim Bentley 2009-04-10 06:48:57 +01:00
parent 5d29da2547
commit b581fcab8f
3 changed files with 16 additions and 4 deletions

View File

@ -89,7 +89,7 @@ class ThemeXML():
color.appendChild(bkc) color.appendChild(bkc)
background.appendChild(color) background.appendChild(color)
def add_font(self, fontname, fontcolor, fontproportion, fonttype=u'main'): def add_font(self, fontname, fontcolor, fontproportion, override, fonttype=u'main', xpos=0, ypos=0 ,width=0, height=0):
background = self.theme_xml.createElement(u'font') background = self.theme_xml.createElement(u'font')
background.setAttribute(u'type',fonttype) background.setAttribute(u'type',fonttype)
self.theme.appendChild(background) self.theme.appendChild(background)
@ -109,6 +109,15 @@ class ThemeXML():
name.appendChild(fn) name.appendChild(fn)
background.appendChild(name) background.appendChild(name)
name = self.theme_xml.createElement(u'location')
name.setAttribute(u'override',override)
if override == u'True':
name.setAttribute(u'x',str(xpos))
name.setAttribute(u'y',str(ypos))
name.setAttribute(u'width',str(width))
name.setAttribute(u'height',str(height))
background.appendChild(name)
def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap): def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
background = self.theme_xml.createElement(u'display') background = self.theme_xml.createElement(u'display')
self.theme.appendChild(background) self.theme.appendChild(background)

View File

@ -248,15 +248,17 @@ class Renderer:
#log.debug(u'_render_lines %s', lines) #log.debug(u'_render_lines %s', lines)
bbox=self._render_lines_unaligned(lines, False) # Main font bbox=self._render_lines_unaligned(lines, False) # Main font
bbox1=self._render_lines_unaligned(lines, True) # Footer Font if lines1 is not None:
bbox1=self._render_lines_unaligned(lines1, True) # Footer Font
# put stuff on background so need to reset before doing the job properly. # put stuff on background so need to reset before doing the job properly.
self._render_background() self._render_background()
x, y = self._correctAlignment(self._rect, bbox) x, y = self._correctAlignment(self._rect, bbox)
bbox=self._render_lines_unaligned(lines, False, (x,y)) bbox=self._render_lines_unaligned(lines, False, (x,y))
x, y = self._correctAlignment(self._rect_footer, bbox1) if lines1 is not None:
bbox=self._render_lines_unaligned(lines1, True, (x,y) ) x, y = self._correctAlignment(self._rect_footer, bbox1)
bbox=self._render_lines_unaligned(lines1, True, (x,y) )
log.debug(u'render lines DONE') log.debug(u'render lines DONE')

View File

@ -31,6 +31,7 @@ class GeneralTab(SettingsTab):
def __init__(self, screen_list): def __init__(self, screen_list):
SettingsTab.__init__(self, translate(u'GeneralTab', u'General')) SettingsTab.__init__(self, translate(u'GeneralTab', u'General'))
self.screen_list = screen_list self.screen_list = screen_list
print screen_list
def setupUi(self): def setupUi(self):
self.setObjectName(u'GeneralTab') self.setObjectName(u'GeneralTab')