summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-16 20:39:05 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-16 20:39:05 +0300
commitc106b4914a09fae969f8cb1205b9286dd2beb0e7 (patch)
tree58e34b4ace90c922a3ba061dde59146b4e4b0ed0 /src/gui/widgets/tab.cpp
parent11f10affa92d3868a4a91d45fe4915d36e1400a9 (diff)
downloadmanaplus-c106b4914a09fae969f8cb1205b9286dd2beb0e7.tar.gz
manaplus-c106b4914a09fae969f8cb1205b9286dd2beb0e7.tar.bz2
manaplus-c106b4914a09fae969f8cb1205b9286dd2beb0e7.tar.xz
manaplus-c106b4914a09fae969f8cb1205b9286dd2beb0e7.zip
Improve tab.
Diffstat (limited to 'src/gui/widgets/tab.cpp')
-rw-r--r--src/gui/widgets/tab.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index c70d15850..813ae0ef8 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -61,7 +61,6 @@ Tab::Tab(const Widget2 *const widget) :
gcn::MouseListener(),
gcn::WidgetListener(),
mLabel(new Label(this)),
- mHasMouse(false),
mTabbedArea(nullptr),
mTabColor(&getThemeColor(Theme::TAB)),
mTabOutlineColor(&getThemeColor(Theme::TAB_OUTLINE)),
@@ -76,8 +75,9 @@ Tab::Tab(const Widget2 *const widget) :
mPlayerFlashOutlineColor(&getThemeColor(Theme::TAB_PLAYER_FLASH_OUTLINE)),
mFlash(0),
mVertexes(new ImageCollection),
+ mMode(0),
mRedraw(true),
- mMode(0)
+ mHasMouse(false)
{
init();
}
@@ -146,11 +146,11 @@ void Tab::updateAlpha()
{
for (int t = 0; t < TAB_COUNT; t++)
{
- Skin *skin = tabImg[t];
+ Skin *const skin = tabImg[t];
if (skin)
{
const ImageRect &rect = skin->getBorder();
- Image *image = rect.grid[a];
+ Image *const image = rect.grid[a];
if (image)
image->setAlpha(mAlpha);
}
@@ -221,21 +221,17 @@ void Tab::draw(gcn::Graphics *graphics)
mRedraw = false;
mVertexes->clear();
static_cast<Graphics*>(graphics)->calcWindow(mVertexes, 0, 0,
- getWidth(), getHeight(), rect);
+ mDimension.width, mDimension.height, rect);
}
static_cast<Graphics*>(graphics)->drawTile(mVertexes);
}
else
{
- static_cast<Graphics*>(graphics)->
- drawImageRect(0, 0, getWidth(), getHeight(), skin->getBorder());
+ static_cast<Graphics*>(graphics)->drawImageRect(
+ 0, 0, mDimension.width, mDimension.height, skin->getBorder());
}
-// static_cast<Graphics*>(graphics)->
-// drawImageRect(0, 0, getWidth(), getHeight(), tabImg[mode]);
-
- // draw label
drawChildren(graphics);
BLOCK_END("Tab::draw")
}
@@ -280,7 +276,7 @@ void Tab::setTabbedArea(TabbedArea* tabbedArea)
mTabbedArea = tabbedArea;
}
-TabbedArea* Tab::getTabbedArea()
+TabbedArea* Tab::getTabbedArea() const
{
return mTabbedArea;
}