- textLayout.set_markup(self._subtitle)
- textWidth, textHeight = textLayout.get_pixel_size()
- subtitleTextX = backWidth / 2 - textWidth / 2
- subtitleTextY = backHeight - textHeight - self._buttonImage.get_height()
+ subtitleLayout = pango.Layout(pangoContext)
+ subtitleLayout.set_markup("<b>%s</b>" % self._title)
+ textWidth, textHeight = subtitleLayout.get_pixel_size()
+ textX = self._dims[0] / 2 - textWidth / 2
+ textY = subtitleTextY - textHeight
+
+ 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(
+ startContent[0],
+ startContent[1],
+ endContent[0] - startContent[0],
+ endContent[1] - startContent[1],
+ )
+ cairoContext.set_source_rgba(0.9, 0.9, 0.9, 0.75)
+ cairoContext.fill()
+
+ # title
+ if self._title or self._subtitle: