Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tutorius
diff options
context:
space:
mode:
authorisen <isen@isen-desktop.(none)>2009-09-23 20:19:41 (GMT)
committer isen <isen@isen-desktop.(none)>2009-09-23 20:19:41 (GMT)
commit335833bba32a4643e95bd31337637f5e2a075cee (patch)
tree1d5274955a376b8298b82e428d70cbf8ffeabcfd /tutorius
parentaf047f0f82d9510cbfc54b02576e95effa802c78 (diff)
first changes but not working
Diffstat (limited to 'tutorius')
-rw-r--r--tutorius/overlayer.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tutorius/overlayer.py b/tutorius/overlayer.py
index 931949d..592b8f0 100644
--- a/tutorius/overlayer.py
+++ b/tutorius/overlayer.py
@@ -157,7 +157,7 @@ class TextBubble(gtk.Widget):
A CanvasDrawableWidget drawing a round textbox and a tail pointing
to a specified widget.
"""
- def __init__(self, text, speaker=None, tailpos=[0,0]):
+ def __init__(self, text, speaker=None, tailpos=[0,0], tailpos2=[0,0]):
"""
Creates a new cairo rendered text bubble.
@@ -176,6 +176,7 @@ class TextBubble(gtk.Widget):
self.label = text
self.speaker = speaker
self.tailpos = tailpos
+ self.tailpos2= tailpos2
self.line_width = 5
self.padding = 20
@@ -206,6 +207,15 @@ class TextBubble(gtk.Widget):
context.set_line_width(self.line_width)
context.set_source_rgb(*xo_line_color)
context.stroke_preserve()
+
+ # draw bubble tail2 if present
+ if self.tailpos2 != [0,0]:
+ context.move_to(xradius-width/4, yradius)
+ context.line_to(self.tailpos2[0], self.tailpos2[1])
+ context.line_to(xradius+width/4, yradius)
+ context.set_line_width(self.line_width)
+ context.set_source_rgb(*xo_line_color)
+ context.stroke_preserve()
# bubble border
context.move_to(width-self.padding, 0.0)
@@ -235,6 +245,15 @@ class TextBubble(gtk.Widget):
context.set_line_width(self.line_width)
context.set_source_rgb(*xo_fill_color)
context.fill()
+
+ # bubble painting. Redrawing the inside after the tail will combine
+ if self.tailpos2 != [0,0]:
+ context.move_to(xradius-width/4, yradius)
+ context.line_to(self.tailpos2[0], self.tailpos2[1])
+ context.line_to(xradius+width/4, yradius)
+ context.set_line_width(self.line_width)
+ context.set_source_rgb(*xo_fill_color)
+ context.fill()
context.set_source_rgb(1.0, 1.0, 1.0)
pangoctx = pangocairo.CairoContext(context)