projects
/
naja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65d95ee
)
Default to using full box_width
author
Neil
<neil@dip.sun.ac.za>
Sat, 17 May 2014 10:14:54 +0000
(12:14 +0200)
committer
Neil
<neil@dip.sun.ac.za>
Sat, 17 May 2014 10:16:01 +0000
(12:16 +0200)
naja/widgets/text.py
patch
|
blob
|
history
diff --git
a/naja/widgets/text.py
b/naja/widgets/text.py
index 1d9732e4ced817da97dbdb9207107a59c84394cb..3df09488e3a170502426b79d7724b196d2d22c32 100644
(file)
--- a/
naja/widgets/text.py
+++ b/
naja/widgets/text.py
@@
-133,6
+133,8
@@
class TextBoxWidget(TextWidget):
PALETTE.BLACK))
self.box_width = kwargs.pop('box_width', 0)
PALETTE.BLACK))
self.box_width = kwargs.pop('box_width', 0)
+ self.full_width = kwargs.pop('full_width', True)
+
super(TextBoxWidget, self).__init__(*args, **kwargs)
def lines(self, image_map):
super(TextBoxWidget, self).__init__(*args, **kwargs)
def lines(self, image_map):
@@
-219,6
+221,9
@@
class TextBoxWidget(TextWidget):
width = max(width, line_rect.width + self.padding * 2)
height += line_rect.height
width = max(width, line_rect.width + self.padding * 2)
height += line_rect.height
+ if self.full_width:
+ width = max(width, self.box_width)
+
self.surface = pygame.surface.Surface((width, height),
pygame.locals.SRCALPHA)
self.surface.fill(self.bg_colour)
self.surface = pygame.surface.Surface((width, height),
pygame.locals.SRCALPHA)
self.surface.fill(self.bg_colour)