summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-28 18:50:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-28 19:04:29 +0300
commit285db66255e63f3967ae806eb888d4742cff3d9f (patch)
tree8b0a34c8ccec3b4f20176e1f64993f500e6dd73b
parentd2b9c0a5ec5cd14736c96a28dcccb5f298a5f0aa (diff)
downloadmv-285db66255e63f3967ae806eb888d4742cff3d9f.tar.gz
mv-285db66255e63f3967ae806eb888d4742cff3d9f.tar.bz2
mv-285db66255e63f3967ae806eb888d4742cff3d9f.tar.xz
mv-285db66255e63f3967ae806eb888d4742cff3d9f.zip
Move simple colors to themes.
Need add to all themes, or all simple colors will be black.
-rw-r--r--data/graphics/gui/colors.xml10
-rw-r--r--data/themes/blackwood/colors.xml10
-rw-r--r--data/themes/enchilado/colors.xml10
-rw-r--r--data/themes/mana/colors.xml10
-rw-r--r--data/themes/pink/colors.xml10
-rw-r--r--data/themes/redandblack/colors.xml10
-rw-r--r--data/themes/wood/colors.xml10
-rw-r--r--src/gui/theme.cpp11
-rw-r--r--src/gui/theme.h9
-rw-r--r--src/gui/widgets/browserbox.cpp27
-rw-r--r--src/gui/widgets/browserbox.h30
11 files changed, 118 insertions, 29 deletions
diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml
index 2091494b3..4203b482c 100644
--- a/data/graphics/gui/colors.xml
+++ b/data/graphics/gui/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/blackwood/colors.xml b/data/themes/blackwood/colors.xml
index ef06fdc9f..523d164c7 100644
--- a/data/themes/blackwood/colors.xml
+++ b/data/themes/blackwood/colors.xml
@@ -48,6 +48,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/enchilado/colors.xml b/data/themes/enchilado/colors.xml
index f4ae878e4..0c19f5a47 100644
--- a/data/themes/enchilado/colors.xml
+++ b/data/themes/enchilado/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/mana/colors.xml b/data/themes/mana/colors.xml
index c623b8396..45937e268 100644
--- a/data/themes/mana/colors.xml
+++ b/data/themes/mana/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/pink/colors.xml b/data/themes/pink/colors.xml
index 6be3ab630..f2b20567e 100644
--- a/data/themes/pink/colors.xml
+++ b/data/themes/pink/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/redandblack/colors.xml b/data/themes/redandblack/colors.xml
index 8fe785114..d5e6a7f7b 100644
--- a/data/themes/redandblack/colors.xml
+++ b/data/themes/redandblack/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#0000FF" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/data/themes/wood/colors.xml b/data/themes/wood/colors.xml
index 1f1ac1776..606b45301 100644
--- a/data/themes/wood/colors.xml
+++ b/data/themes/wood/colors.xml
@@ -49,6 +49,16 @@
<color id="WARNING" color="#FF0000" />
<color id="PLAYER_ADVANCED" color="#005000" />
+ <color id="RED" color="#ff0000" />
+ <color id="GREEN" color="#009000" />
+ <color id="BLUE" color="#0000ff" />
+ <color id="ORANGE" color="#e0980e" />
+ <color id="YELLOW" color="#f1dc27" />
+ <color id="PINK" color="#ff00d8" />
+ <color id="PURPLE" color="#8415e2" />
+ <color id="GRAY" color="#919191" />
+ <color id="BROWN" color="#8e4c17" />
+
<progressbar id="DEFAULT" color="#969696" />
<progressbar id="HP" color="#ff0000,e28000,c38948,0f6a20" />
<progressbar id="MP" color="#1a66e6" />
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 15554044d..0607564f9 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -644,7 +644,16 @@ static int readColorType(const std::string &type)
"SERVER_VERSION_NOT_SUPPORTED",
"WARNING",
"CHARM",
- "PLAYER_ADVANCED"
+ "PLAYER_ADVANCED",
+ "RED",
+ "GREEN",
+ "BLUE",
+ "ORANGE",
+ "YELLOW",
+ "PINK",
+ "PURPLE",
+ "GRAY",
+ "BROWN"
};
if (type.empty())
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 4e6a64a6f..fbc6f13da 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -189,6 +189,15 @@ class Theme : public Palette, public ConfigListener
WARNING,
CHARM,
PLAYER_ADVANCED,
+ RED,
+ GREEN,
+ BLUE,
+ ORANGE,
+ YELLOW,
+ PINK,
+ PURPLE,
+ GRAY,
+ BROWN,
THEME_COLORS_END
};
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index bb83c1159..65a25363d 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -68,6 +68,15 @@ BrowserBox::BrowserBox(unsigned int mode, bool opaque):
mBackgroundColor = Theme::getThemeColor(Theme::BACKGROUND);
mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
mHyperLinkColor = Theme::getThemeColor(Theme::HYPERLINK);
+ mColors[RED] = Theme::getThemeColor(Theme::RED);
+ mColors[GREEN] = Theme::getThemeColor(Theme::GREEN);
+ mColors[BLUE] = Theme::getThemeColor(Theme::BLUE);
+ mColors[ORANGE] = Theme::getThemeColor(Theme::ORANGE);
+ mColors[YELLOW] = Theme::getThemeColor(Theme::YELLOW);
+ mColors[PINK] = Theme::getThemeColor(Theme::PINK);
+ mColors[PURPLE] = Theme::getThemeColor(Theme::PURPLE);
+ mColors[GRAY] = Theme::getThemeColor(Theme::GRAY);
+ mColors[BROWN] = Theme::getThemeColor(Theme::BROWN);
}
BrowserBox::~BrowserBox()
@@ -478,15 +487,15 @@ int BrowserBox::calcHeight()
switch (c)
{
- case '1': selColor = RED; break;
- case '2': selColor = GREEN; break;
- case '3': selColor = BLUE; break;
- case '4': selColor = ORANGE; break;
- case '5': selColor = YELLOW; break;
- case '6': selColor = PINK; break;
- case '7': selColor = PURPLE; break;
- case '8': selColor = GRAY; break;
- case '9': selColor = BROWN; break;
+ case '1': selColor = mColors[RED]; break;
+ case '2': selColor = mColors[GREEN]; break;
+ case '3': selColor = mColors[BLUE]; break;
+ case '4': selColor = mColors[ORANGE]; break;
+ case '5': selColor = mColors[YELLOW]; break;
+ case '6': selColor = mColors[PINK]; break;
+ case '7': selColor = mColors[PURPLE]; break;
+ case '8': selColor = mColors[GRAY]; break;
+ case '9': selColor = mColors[BROWN]; break;
case '0':
default:
selColor = textColor;
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 9969bfd3b..cd69ce56f 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -147,27 +147,18 @@ class BrowserBox : public gcn::Widget,
AUTO_WRAP /**< Maybe it needs a fix or to be redone. */
};
- /**
- * BrowserBox colors.
- *
- * NOTES (by Javila):
- * - color values is "0x" prefix followed by HTML color style.
- * - we can add up to 10 different colors: [0..9].
- * - not all colors will be fine with all backgrounds due transparent
- * windows and widgets. So, I think it's better keep BrowserBox
- * opaque (white background) by default.
- */
enum
{
- RED = 0xff0000, /**< Color 1 */
- GREEN = 0x009000, /**< Color 2 */
- BLUE = 0x0000ff, /**< Color 3 */
- ORANGE = 0xe0980e, /**< Color 4 */
- YELLOW = 0xf1dc27, /**< Color 5 */
- PINK = 0xff00d8, /**< Color 6 */
- PURPLE = 0x8415e2, /**< Color 7 */
- GRAY = 0x919191, /**< Color 8 */
- BROWN = 0x8e4c17 /**< Color 9 */
+ RED = 0,
+ GREEN = 1,
+ BLUE = 2,
+ ORANGE = 3,
+ YELLOW = 4,
+ PINK = 5,
+ PURPLE = 6,
+ GRAY = 7,
+ BROWN = 8,
+ COLORS_MAX = 9
};
/**
@@ -229,6 +220,7 @@ class BrowserBox : public gcn::Widget,
gcn::Color mBackgroundColor;
gcn::Color mHighlightColor;
gcn::Color mHyperLinkColor;
+ gcn::Color mColors[COLORS_MAX];
};
#endif