From c106b4914a09fae969f8cb1205b9286dd2beb0e7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Jun 2013 20:39:05 +0300 Subject: Improve tab. --- src/gui/widgets/tab.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/gui/widgets/tab.cpp') 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)->calcWindow(mVertexes, 0, 0, - getWidth(), getHeight(), rect); + mDimension.width, mDimension.height, rect); } static_cast(graphics)->drawTile(mVertexes); } else { - static_cast(graphics)-> - drawImageRect(0, 0, getWidth(), getHeight(), skin->getBorder()); + static_cast(graphics)->drawImageRect( + 0, 0, mDimension.width, mDimension.height, skin->getBorder()); } -// static_cast(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; } -- cgit v1.2.3-70-g09d2