summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-04 20:39:27 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-04 20:39:27 +0300
commit087576e8e9e7c1555f6cabe9d34317bdddff2c78 (patch)
treef9de1d5a1c3f7f239739d39b45d99a00bd961c17 /src/gui
parentcdca37e368923c0298691847eba1c394a287e52f (diff)
downloadmanaverse-087576e8e9e7c1555f6cabe9d34317bdddff2c78.tar.gz
manaverse-087576e8e9e7c1555f6cabe9d34317bdddff2c78.tar.bz2
manaverse-087576e8e9e7c1555f6cabe9d34317bdddff2c78.tar.xz
manaverse-087576e8e9e7c1555f6cabe9d34317bdddff2c78.zip
add ability to set text colors on ministatus window bars.
Also add PROGRESSBAR_OUTLINE color.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/theme.cpp1
-rw-r--r--src/gui/theme.h1
-rw-r--r--src/gui/widgets/progressbar.cpp2
-rw-r--r--src/gui/windows/ministatuswindow.cpp30
-rw-r--r--src/gui/windows/ministatuswindow.h5
5 files changed, 24 insertions, 15 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 8f5d49bfa..cfbe26d03 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -781,6 +781,7 @@ static int readColorType(const std::string &type)
"OUTLINE",
"BORDER",
"PROGRESS_BAR",
+ "PROGRESS_BAR_OUTLINE",
"BUTTON",
"BUTTON_OUTLINE",
"BUTTON_DISABLED",
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 0ed7c2fb1..08d912430 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -224,6 +224,7 @@ class Theme final : public Palette, public ConfigListener
OUTLINE,
BORDER,
PROGRESS_BAR,
+ PROGRESS_BAR_OUTLINE,
BUTTON,
BUTTON_OUTLINE,
BUTTON_DISABLED,
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index dd44a3b9c..71a7c641f 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -47,7 +47,7 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress,
mBackgroundColor(Theme::getProgressColor(backColor >= 0
? backColor : 0, mProgress)),
mBackgroundColorToGo(mBackgroundColor),
- mForegroundColor2(getThemeColor(Theme::OUTLINE)),
+ mForegroundColor2(getThemeColor(Theme::PROGRESS_BAR_OUTLINE)),
mText(),
mVertexes(new ImageCollection),
mProgressPalette(backColor),
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index cc666f614..d2ff6b0bb 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -62,30 +62,33 @@ MiniStatusWindow::MiniStatusWindow() :
mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2),
mMaxX(0),
// TRANSLATORS: status bar name
- mHpBar(createBar(0, 100, 0, Theme::PROG_HP, "hp bar", _("health bar"))),
+ mHpBar(createBar(0, 100, 0, Theme::PROGRESS_BAR, Theme::PROG_HP,
+ "hp bar", _("health bar"))),
mMpBar(Net::getGameHandler()->canUseMagicBar()
- ? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic()
+ ? createBar(0, 100, 0, Theme::PROGRESS_BAR,
+ Net::getPlayerHandler()->canUseMagic()
// TRANSLATORS: status bar name
? Theme::PROG_MP : Theme::PROG_NO_MP, "mp bar", _("mana bar"))
: nullptr),
- mXpBar(createBar(0, 100, 0, Theme::PROG_EXP,
+ mXpBar(createBar(0, 100, 0, Theme::PROGRESS_BAR, Theme::PROG_EXP,
// TRANSLATORS: status bar name
"xp bar", _("experience bar"))),
mJobBar(nullptr),
- mWeightBar(createBar(0, 140, 0, Theme::PROG_WEIGHT,
+ mWeightBar(createBar(0, 140, 0, Theme::PROGRESS_BAR, Theme::PROG_WEIGHT,
// TRANSLATORS: status bar name
"weight bar", _("weight bar"))),
- mInvSlotsBar(createBar(0, 45, 0, Theme::PROG_INVY_SLOTS,
+ mInvSlotsBar(createBar(0, 45, 0,
+ Theme::SLOTS_BAR, Theme::PROG_INVY_SLOTS,
// TRANSLATORS: status bar name
"inventory slots bar", _("inventory slots bar"))),
- mMoneyBar(createBar(0, 130, 0, Theme::PROG_INVY_SLOTS,
+ mMoneyBar(createBar(0, 130, 0, Theme::SLOTS_BAR, Theme::PROG_INVY_SLOTS,
// TRANSLATORS: status bar name
"money bar", _("money bar"))),
- mArrowsBar(createBar(0, 50, 0, Theme::PROG_INVY_SLOTS,
+ mArrowsBar(createBar(0, 50, 0, Theme::SLOTS_BAR, Theme::PROG_INVY_SLOTS,
// TRANSLATORS: status bar name
"arrows bar", _("arrows bar"))),
mStatusBar(createBar(100, (config.getIntValue("fontSize") > 16
- ? 250 : 165), 0, Theme::PROG_EXP,
+ ? 250 : 165), 0, Theme::PROGRESS_BAR, Theme::PROG_EXP,
// TRANSLATORS: status bar name
"status bar", _("status bar"))),
mTextPopup(new TextPopup),
@@ -108,9 +111,9 @@ MiniStatusWindow::MiniStatusWindow() :
if (job)
{
- mJobBar = createBar(0, 100, 0, Theme::PROG_JOB, "job bar",
+ mJobBar = createBar(0, 100, 0, Theme::PROGRESS_BAR, Theme::PROG_JOB,
// TRANSLATORS: status bar name
- _("job bar"));
+ "job bar", _("job bar"));
StatusWindow::updateJobBar(mJobBar);
}
@@ -154,14 +157,17 @@ MiniStatusWindow::~MiniStatusWindow()
ProgressBar *MiniStatusWindow::createBar(const float progress,
const int width, const int height,
- const int color,
+ const int textColor,
+ const int backColor,
const std::string &name,
const std::string &description)
{
ProgressBar *const bar = new ProgressBar(this,
- progress, width, height, color);
+ progress, width, height, backColor);
bar->setActionEventId(name);
bar->setId(description);
+ bar->setColor(Theme::getThemeColor(textColor),
+ Theme::getThemeColor(textColor + 1));
mBars.push_back(bar);
mBarNames[name] = bar;
return bar;
diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h
index 82ba64034..2ec31ef25 100644
--- a/src/gui/windows/ministatuswindow.h
+++ b/src/gui/windows/ministatuswindow.h
@@ -96,8 +96,9 @@ class MiniStatusWindow final : public Popup,
private:
bool isInBar(ProgressBar *bar, int x, int y) const;
- ProgressBar *createBar(const float progress, const int width,
- const int height, const int color,
+ ProgressBar *createBar(const float progress,
+ const int width, const int height,
+ const int textColor, const int backColor,
const std::string &name,
const std::string &description) A_WARN_UNUSED;