summaryrefslogtreecommitdiff
path: root/src/gui/widgets/skilllistbox.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-25 01:58:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-25 01:58:52 +0300
commite3682e2cdcb59c36792f6f9c39569e0af01088f0 (patch)
treeb4d7a665652e4a8c00f28d557f96b120abc62002 /src/gui/widgets/skilllistbox.h
parent1b3a9751ae558e45c614f04525d5ff65e3c0fc1e (diff)
downloadplus-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.gz
plus-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.bz2
plus-e3682e2cdcb59c36792f6f9c39569e0af01088f0.tar.xz
plus-e3682e2cdcb59c36792f6f9c39569e0af01088f0.zip
Dont set global color variables before drawing text.
This allow not set actual OpenGL color on each call because it useless for drawing text.
Diffstat (limited to 'src/gui/widgets/skilllistbox.h')
-rw-r--r--src/gui/widgets/skilllistbox.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index 344bffa59..e012aabd3 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -133,7 +133,6 @@ class SkillListBox final : public ListBox
}
}
- graphics->setColorAll(mTextColor, mTextColor2);
for (int i = 0, y = 1 + mPadding;
i < model->getNumberOfElements();
++i, y += getRowHeight())
@@ -144,11 +143,19 @@ class SkillListBox final : public ListBox
const SkillData *const data = e->data;
const std::string &description = data->description;
graphics->drawImage(data->icon, mPadding, y);
- font->drawString(graphics, data->name, mTextPadding, y);
+ font->drawString(graphics,
+ mTextColor,
+ mTextColor2,
+ data->name,
+ mTextPadding, y);
if (!description.empty())
{
- font->drawString(graphics, description,
- mTextPadding, y + space);
+ font->drawString(graphics,
+ mTextColor,
+ mTextColor2,
+ description,
+ mTextPadding,
+ y + space);
}
if (e->skillLevelWidth < 0)
@@ -157,8 +164,12 @@ class SkillListBox final : public ListBox
e->skillLevelWidth = font->getWidth(e->skillLevel) + 1;
}
- font->drawString(graphics, e->skillLevel, width2
- - e->skillLevelWidth, y);
+ font->drawString(graphics,
+ mTextColor,
+ mTextColor2,
+ e->skillLevel,
+ width2 - e->skillLevelWidth,
+ y);
}
}
}