summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-28 23:43:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-28 23:43:54 +0300
commitd7f2497abbc2be9ec2f8617232230d5328b1046d (patch)
tree6dc56d8444710121e54b619bb506af951076328b /src/gui
parent436abf9f8cc33dfff1fe21b8ec5e61854facbd0c (diff)
downloadplus-d7f2497abbc2be9ec2f8617232230d5328b1046d.tar.gz
plus-d7f2497abbc2be9ec2f8617232230d5328b1046d.tar.bz2
plus-d7f2497abbc2be9ec2f8617232230d5328b1046d.tar.xz
plus-d7f2497abbc2be9ec2f8617232230d5328b1046d.zip
Fix textbox font color.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/speechbubble.cpp4
-rw-r--r--src/gui/widgets/textbox.cpp4
-rw-r--r--src/gui/widgets/textbox.h14
3 files changed, 4 insertions, 18 deletions
diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp
index fc820793c..1f96f56de 100644
--- a/src/gui/speechbubble.cpp
+++ b/src/gui/speechbubble.cpp
@@ -45,7 +45,7 @@ SpeechBubble::SpeechBubble() :
mCaption->setFont(boldFont);
mSpeechBox->setEditable(false);
mSpeechBox->setOpaque(false);
- mSpeechBox->setTextColor(&Theme::getThemeColor(Theme::BUBBLE_TEXT));
+ mSpeechBox->setForegroundColor(Theme::getThemeColor(Theme::BUBBLE_TEXT));
add(mCaption);
add(mSpeechBox);
@@ -64,7 +64,7 @@ void SpeechBubble::setText(const std::string &text, const bool showName)
if (text == mText && (mCaption->getWidth() <= mSpeechBox->getMinWidth()))
return;
- mSpeechBox->setTextColor(&Theme::getThemeColor(Theme::BUBBLE_TEXT));
+ mSpeechBox->setForegroundColor(Theme::getThemeColor(Theme::BUBBLE_TEXT));
int width = mCaption->getWidth() + 2 * getPadding();
mSpeechBox->setTextWrapped(text, 130 > width ? 130 : width);
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 3254f9f28..8af080294 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -35,9 +35,9 @@
TextBox::TextBox() :
gcn::TextBox(),
- mMinWidth(getWidth()),
- mTextColor(&Theme::getThemeColor(Theme::TEXTBOX))
+ mMinWidth(getWidth())
{
+ mForegroundColor = Theme::getThemeColor(Theme::TEXTBOX);
setOpaque(false);
setFrameSize(0);
}
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 61cf6f665..36362e011 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -40,9 +40,6 @@ class TextBox final : public gcn::TextBox
*/
TextBox();
- inline void setTextColor(const gcn::Color *color)
- { mTextColor = color; }
-
/**
* Sets the text after wrapping it to the current width of the widget.
*/
@@ -54,21 +51,10 @@ class TextBox final : public gcn::TextBox
int getMinWidth() const
{ return mMinWidth; }
- /**
- * Draws the text.
- */
- inline void draw(gcn::Graphics *graphics) override
- {
- if (mTextColor)
- mForegroundColor = *mTextColor;
- gcn::TextBox::draw(graphics);
- }
-
void keyPressed(gcn::KeyEvent& keyEvent) override;
private:
int mMinWidth;
- const gcn::Color *mTextColor;
};
#endif