diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-03 12:13:16 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-03 12:13:16 -0700 |
commit | 269e05e71f09cac3d181f2042cde01e5541658f3 (patch) | |
tree | c8c65fac80dd78f8ec1bf6fb5c59eef9479bb1be /src/gui/browserbox.cpp | |
parent | 0cf29b14232b08c7db9259bce26e96b59dac750c (diff) | |
download | mana-269e05e71f09cac3d181f2042cde01e5541658f3.tar.gz mana-269e05e71f09cac3d181f2042cde01e5541658f3.tar.bz2 mana-269e05e71f09cac3d181f2042cde01e5541658f3.tar.xz mana-269e05e71f09cac3d181f2042cde01e5541658f3.zip |
Made highlights configurable through the color dialog.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/browserbox.cpp')
-rw-r--r-- | src/gui/browserbox.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index 6fd0482a..cd5479c8 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -122,7 +122,18 @@ void BrowserBox::addRow(const std::string &row) //discard older rows when a row limit has been set if (mMaxRows > 0) { - while (mTextRows.size() > mMaxRows) mTextRows.pop_front(); + while (mTextRows.size() > mMaxRows) + { + mTextRows.pop_front(); + for (unsigned int i = 0; i < mLinks.size(); i++) + { + mLinks[i].y1 -= font->getHeight(); + mLinks[i].y2 -= font->getHeight(); + + if (mLinks[i].y1 < 0) + mLinks.erase(mLinks.begin() + i); + } + } } // Auto size mode @@ -238,9 +249,10 @@ void BrowserBox::draw(gcn::Graphics *graphics) if (mSelectedLink >= 0) { + bool valid; if ((mHighMode & BACKGROUND)) { - graphics->setColor(gcn::Color(HIGHLIGHT)); + graphics->setColor(gcn::Color(textColour->getColour('H', valid))); graphics->fillRectangle(gcn::Rectangle( mLinks[mSelectedLink].x1, mLinks[mSelectedLink].y1, @@ -251,7 +263,6 @@ void BrowserBox::draw(gcn::Graphics *graphics) if ((mHighMode & UNDERLINE)) { - bool valid; graphics->setColor(gcn::Color(textColour->getColour('<', valid))); graphics->drawLine( mLinks[mSelectedLink].x1, |