summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r--src/gui/widgets/browserbox.cpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 7df70bd04..65a25363d 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -64,6 +64,19 @@ BrowserBox::BrowserBox(unsigned int mode, bool opaque):
{
setFocusable(true);
addMouseListener(this);
+
+ 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()
@@ -310,7 +323,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
if (mOpaque)
{
- graphics->setColor(Theme::getThemeColor(Theme::BACKGROUND));
+ graphics->setColor(mBackgroundColor);
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
@@ -319,7 +332,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
{
if ((mHighMode & BACKGROUND))
{
- graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT));
+ graphics->setColor(mHighlightColor);
graphics->fillRectangle(gcn::Rectangle(
mLinks[mSelectedLink].x1,
mLinks[mSelectedLink].y1,
@@ -330,7 +343,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
if ((mHighMode & UNDERLINE))
{
- graphics->setColor(Theme::getThemeColor(Theme::HYPERLINK));
+ graphics->setColor(mHyperLinkColor);
graphics->drawLine(
mLinks[mSelectedLink].x1,
mLinks[mSelectedLink].y2,
@@ -474,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;