~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/speechbubble.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi, Andrei Karas, Patrick Matthäi
  • Date: 2013-05-18 21:06:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130518210629-3trtowluum0tekob
Tags: 1.3.5.12-1
[ Andrei Karas ]
* Add new files to copyright file.

[ Patrick Matthäi ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    mCaption->setFont(boldFont);
47
47
    mSpeechBox->setEditable(false);
48
48
    mSpeechBox->setOpaque(false);
49
 
    mSpeechBox->setForegroundColor(getThemeColor(Theme::BUBBLE_TEXT));
 
49
    mSpeechBox->setForegroundColorAll(getThemeColor(Theme::BUBBLE_TEXT),
 
50
        getThemeColor(Theme::BUBBLE_TEXT_OUTLINE));
50
51
 
51
52
    add(mCaption);
52
53
    add(mSpeechBox);
53
54
}
54
55
 
55
56
void SpeechBubble::setCaption(const std::string &name,
56
 
                              const gcn::Color *const color)
 
57
                              const gcn::Color *const color1,
 
58
                              const gcn::Color *const color2)
57
59
{
58
60
    mCaption->setCaption(name);
59
61
    mCaption->adjustSize();
60
 
    mCaption->setForegroundColor(*color);
 
62
    mCaption->setForegroundColorAll(*color1, *color2);
61
63
}
62
64
 
63
65
void SpeechBubble::setText(const std::string &text, const bool showName)
65
67
    if (text == mText && (mCaption->getWidth() <= mSpeechBox->getMinWidth()))
66
68
        return;
67
69
 
68
 
    mSpeechBox->setForegroundColor(getThemeColor(Theme::BUBBLE_TEXT));
 
70
    mSpeechBox->setForegroundColorAll(getThemeColor(Theme::BUBBLE_TEXT),
 
71
        getThemeColor(Theme::BUBBLE_TEXT_OUTLINE));
69
72
 
70
73
    int width = mCaption->getWidth() + 2 * getPadding();
71
74
    mSpeechBox->setTextWrapped(text, 130 > width ? 130 : width);