Skip to content

Commit

Permalink
WidgetMessagesMixin: handle multiple-line messages
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Dec 23, 2016
1 parent be22b64 commit a2d4385
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Orange/widgets/utils/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def update_message_state(self):
elif self.message_bar is not None:
font_size = self.message_bar.fontInfo().pixelSize()
group = messages[0].group
text = str(messages[0]) if len(messages) == 1 \
text = str(messages[0]).split("\n")[0] if len(messages) == 1 \
else "{} problems during execution".format(len(messages))
# TODO: fix tooltip background color - it is not white
tooltip = ''.join(
Expand All @@ -346,7 +346,8 @@ def update_message_state(self):
&nbsp;&nbsp;&nbsp;</nobr>
<span style="font-size:9pt"><br></span>
</p>'''.
format(msg.group.bar_background, font_size, str(msg))
format(msg.group.bar_background, font_size,
str(msg).replace("\n", "<br/>&nbsp;&nbsp;&nbsp; "))
for msg in messages)
self._set_message_bar(group, text, tooltip)

Expand Down

0 comments on commit a2d4385

Please sign in to comment.