201
201
if not self.force_page:
202
202
self.display.buildHtml(serviceItem)
203
203
raw_html = serviceItem.get_rendered_frame(0)
204
preview = self.display.text(raw_html)
204
self.display.text(raw_html)
205
preview = self.display.preview()
205
206
# Reset the real screen size for subsequent render requests
206
207
self._calculate_default()
304
305
The theme to build a text block for.
306
307
log.debug(u'_build_text_rectangle')
308
main_rect = self.get_main_rectangle(theme)
309
footer_rect = self.get_main_rectangle(theme)
310
self._set_text_rectangle(main_rect, footer_rect)
312
def get_main_rectangle(self, theme):
314
Calculates the placement and size of the main rectangle.
317
The theme information
309
319
if not theme.font_main_override:
310
main_rect = QtCore.QRect(10, 0, self.width - 20, self.footer_start)
320
return QtCore.QRect(10, 0, self.width - 20, self.footer_start)
312
main_rect = QtCore.QRect(theme.font_main_x, theme.font_main_y,
322
return QtCore.QRect(theme.font_main_x, theme.font_main_y,
313
323
theme.font_main_width - 1, theme.font_main_height - 1)
325
def get_footer_rectangle(self, theme):
327
Calculates the placement and size of the footer rectangle.
330
The theme information
314
332
if not theme.font_footer_override:
315
footer_rect = QtCore.QRect(10, self.footer_start, self.width - 20,
333
return QtCore.QRect(10, self.footer_start, self.width - 20,
316
334
self.height - self.footer_start)
318
footer_rect = QtCore.QRect(theme.font_footer_x,
336
return QtCore.QRect(theme.font_footer_x,
319
337
theme.font_footer_y, theme.font_footer_width - 1,
320
338
theme.font_footer_height - 1)
321
self._set_text_rectangle(main_rect, footer_rect)
323
340
def _set_text_rectangle(self, rect_main, rect_footer):