From 8a34eb90638fe9063e8a501e4359ef9c62a42b48 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 18 May 2010 20:09:03 -0500 Subject: [PATCH] Polishing the presenter --- src/presenter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/presenter.py b/src/presenter.py index 1a23a52..bef0a79 100644 --- a/src/presenter.py +++ b/src/presenter.py @@ -191,19 +191,21 @@ class StreamPresenter(object): pangoContext = self._image.create_pango_context() titleLayout = pango.Layout(pangoContext) - titleLayout.set_markup(self._subtitle) + titleLayout.set_markup("%s" % self._subtitle) textWidth, textHeight = titleLayout.get_pixel_size() subtitleTextX = self._dims[0] / 2 - textWidth / 2 subtitleTextY = self._dims[1] - textHeight - self._buttonImage.get_height() + 10 subtitleLayout = pango.Layout(pangoContext) - subtitleLayout.set_markup(self._title) + subtitleLayout.set_markup("%s" % self._title) textWidth, textHeight = subtitleLayout.get_pixel_size() textX = self._dims[0] / 2 - textWidth / 2 textY = subtitleTextY - textHeight - startContent = 30, textY - 5 - endContent = self._dims[0] - 30, self._dims[1] - 5 + xPadding = min((self._dims[0] - textWidth) / 2 - 5, 5) + yPadding = 5 + startContent = xPadding, textY - yPadding + endContent = self._dims[0] - xPadding, self._dims[1] - yPadding # Control background cairoContext.rectangle( -- 1.7.9.5