clean ups

This commit is contained in:
Andreas Preikschat 2012-05-23 18:46:54 +02:00
parent 4a6697f5a1
commit 1604d863eb
1 changed files with 13 additions and 12 deletions

View File

@ -70,10 +70,10 @@ class Renderer(object):
self.themeManager = themeManager self.themeManager = themeManager
self.imageManager = imageManager self.imageManager = imageManager
self.screens = ScreenList() self.screens = ScreenList()
self.theme_level = ThemeLevel.Global
self.service_theme_name = u'' self.service_theme_name = u''
self.theme_level = u'' self.service_theme_name = u''
self.override_background = None self.item_theme_name = u''
self.bg_frame = None
self.force_page = False self.force_page = False
self.display = MainDisplay(None, self.imageManager, False, self) self.display = MainDisplay(None, self.imageManager, False, self)
self.display.setup() self.display.setup()
@ -91,7 +91,6 @@ class Renderer(object):
self.display.close() self.display.close()
self.display = MainDisplay(None, self.imageManager, False, self) self.display = MainDisplay(None, self.imageManager, False, self)
self.display.setup() self.display.setup()
self.bg_frame = None
self._calculate_default() self._calculate_default()
def update_theme(self, theme_name, old_theme_name=None): def update_theme(self, theme_name, old_theme_name=None):
@ -343,7 +342,6 @@ class Renderer(object):
# 90% is start of footer # 90% is start of footer
self.footer_start = int(self.height * 0.90) self.footer_start = int(self.height * 0.90)
def get_main_rectangle(self, theme_data): def get_main_rectangle(self, theme_data):
""" """
Calculates the placement and size of the main rectangle. Calculates the placement and size of the main rectangle.
@ -357,25 +355,28 @@ class Renderer(object):
return QtCore.QRect(theme_data.font_main_x, theme_data.font_main_y, return QtCore.QRect(theme_data.font_main_x, theme_data.font_main_y,
theme_data.font_main_width - 1, theme_data.font_main_height - 1) theme_data.font_main_width - 1, theme_data.font_main_height - 1)
def get_footer_rectangle(self, theme): def get_footer_rectangle(self, theme_data):
""" """
Calculates the placement and size of the footer rectangle. Calculates the placement and size of the footer rectangle.
``theme`` ``theme_data``
The theme information The theme data.
""" """
if not theme.font_footer_override: if not theme_data.font_footer_override:
return QtCore.QRect(10, self.footer_start, self.width - 20, return QtCore.QRect(10, self.footer_start, self.width - 20,
self.height - self.footer_start) self.height - self.footer_start)
else: else:
return QtCore.QRect(theme.font_footer_x, return QtCore.QRect(theme_data.font_footer_x,
theme.font_footer_y, theme.font_footer_width - 1, theme_data.font_footer_y, theme_data.font_footer_width - 1,
theme.font_footer_height - 1) theme_data.font_footer_height - 1)
def _set_text_rectangle(self, theme_data, rect_main, rect_footer): def _set_text_rectangle(self, theme_data, rect_main, rect_footer):
""" """
Sets the rectangle within which text should be rendered. Sets the rectangle within which text should be rendered.
``theme_data``
The theme data.
``rect_main`` ``rect_main``
The main text block. The main text block.