summaryrefslogtreecommitdiff
path: root/src/gui/widgets/guitable.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-22 21:16:34 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-22 21:16:34 +0300
commit2d17967845119a77aec6388bb27c47339052704a (patch)
tree965b636cf677ddf93a30e8606405594a79b7f105 /src/gui/widgets/guitable.cpp
parent7bedfccf5982534a9cbcb2c18ca0d37df117bfc8 (diff)
downloadmv-2d17967845119a77aec6388bb27c47339052704a.tar.gz
mv-2d17967845119a77aec6388bb27c47339052704a.tar.bz2
mv-2d17967845119a77aec6388bb27c47339052704a.tar.xz
mv-2d17967845119a77aec6388bb27c47339052704a.zip
Improve draw perfomance.
Add new theme color DROPDOWN_SHADOW.
Diffstat (limited to 'src/gui/widgets/guitable.cpp')
-rw-r--r--src/gui/widgets/guitable.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index e25e0bb8c..e02eda88c 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -88,17 +88,17 @@ void GuiTableActionListener::action(const gcn::ActionEvent
}
-GuiTable::GuiTable(TableModel *initial_model, gcn::Color background,
- bool opacity) :
+GuiTable::GuiTable(TableModel *initial_model, bool opacity) :
mLinewiseMode(false),
mWrappingEnabled(false),
mOpaque(opacity),
- mBackgroundColor(background),
mModel(NULL),
mSelectedRow(0),
mSelectedColumn(0),
mTopWidget(NULL)
{
+ mBackgroundColor = Theme::getThemeColor(Theme::BACKGROUND);
+ mHighlightColor = Theme::getThemeColor(Theme::HIGHLIGHT);
setModel(initial_model);
setFocusable(true);
@@ -292,8 +292,8 @@ void GuiTable::draw(gcn::Graphics* graphics)
if (mOpaque)
{
- graphics->setColor(Theme::getThemeColor(Theme::BACKGROUND,
- static_cast<int>(mAlpha * 255.0f)));
+ mBackgroundColor.a = static_cast<int>(mAlpha * 255.0f);
+ graphics->setColor(mBackgroundColor);
graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight()));
}
@@ -304,7 +304,7 @@ void GuiTable::draw(gcn::Graphics* graphics)
first_row = 0;
unsigned rows_nr = 1 + (getHeight() / getRowHeight()); // May overestimate
- // by one.
+ // by one.
unsigned max_rows_nr;
if (mModel->getRows() < first_row)
@@ -343,8 +343,8 @@ void GuiTable::draw(gcn::Graphics* graphics)
widget->setDimension(bounds);
- graphics->setColor(Theme::getThemeColor(Theme::HIGHLIGHT,
- static_cast<int>(mAlpha * 255.0f)));
+ mHighlightColor.a = static_cast<int>(mAlpha * 255.0f);
+ graphics->setColor(mHighlightColor);
if (mSelectedRow > 0)
{