summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-25 18:07:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-25 18:07:58 +0300
commit9569e469a481076bdbc330377bf8445eb32fbaa6 (patch)
tree5afe0076206954d5f1649aedc5bcd9529757be14 /src/gui/widgets/shortcutcontainer.cpp
parent0bcc82648c49db05980e879a13baba2c76264bd4 (diff)
downloadmv-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.gz
mv-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.bz2
mv-9569e469a481076bdbc330377bf8445eb32fbaa6.tar.xz
mv-9569e469a481076bdbc330377bf8445eb32fbaa6.zip
Add safeDraw method into shortcutcontainer childs.
Diffstat (limited to 'src/gui/widgets/shortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index 1ac9a9d69..e38b4c294 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -124,29 +124,30 @@ void ShortcutContainer::drawBackground(Graphics *g)
{
if (mBackgroundImg)
{
- if (isBatchDrawRenders(openGLMode))
- {
- if (mRedraw)
- {
- mRedraw = false;
- mVertexes->clear();
- for (unsigned i = 0; i < mMaxItems; i ++)
- {
- g->calcTileCollection(mVertexes, mBackgroundImg,
- (i % mGridWidth) * mBoxWidth,
- (i / mGridWidth) * mBoxHeight);
- }
- g->finalize(mVertexes);
- }
- g->drawTileCollection(mVertexes);
- }
- else
+ if (mRedraw)
{
+ mRedraw = false;
+ mVertexes->clear();
for (unsigned i = 0; i < mMaxItems; i ++)
{
- g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth,
+ g->calcTileCollection(mVertexes, mBackgroundImg,
+ (i % mGridWidth) * mBoxWidth,
(i / mGridWidth) * mBoxHeight);
}
+ g->finalize(mVertexes);
+ }
+ g->drawTileCollection(mVertexes);
+ }
+}
+
+void ShortcutContainer::safeDrawBackground(Graphics *g)
+{
+ if (mBackgroundImg)
+ {
+ for (unsigned i = 0; i < mMaxItems; i ++)
+ {
+ g->drawImage(mBackgroundImg, (i % mGridWidth) * mBoxWidth,
+ (i / mGridWidth) * mBoxHeight);
}
}
}