summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/scrollarea.cpp99
-rw-r--r--src/gui/widgets/scrollarea.h2
2 files changed, 59 insertions, 42 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 924546329..3da38aaeb 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -318,63 +318,78 @@ void ScrollArea::draw(Graphics *graphics)
BLOCK_START("ScrollArea::draw")
if (mVBarVisible || mHBarVisible)
{
- if (isBatchDrawRenders(openGLMode))
- {
- if (!mOpaque)
- updateCalcFlag(graphics);
- // need add caching or remove calc calls.
-// if (mRedraw)
- {
- mVertexes->clear();
- if (mVBarVisible)
- {
- if (mShowButtons)
- {
- calcButton(graphics, UP);
- calcButton(graphics, DOWN);
- }
- calcVBar(graphics);
- calcVMarker(graphics);
- }
-
- if (mHBarVisible)
- {
- if (mShowButtons)
- {
- calcButton(graphics, LEFT);
- calcButton(graphics, RIGHT);
- }
- calcHBar(graphics);
- calcHMarker(graphics);
- }
- graphics->finalize(mVertexes);
- }
- graphics->drawTileCollection(mVertexes);
- }
- else
+ if (!mOpaque)
+ updateCalcFlag(graphics);
+ // need add caching or remove calc calls.
+// if (mRedraw)
{
+ mVertexes->clear();
if (mVBarVisible)
{
if (mShowButtons)
{
- drawButton(graphics, UP);
- drawButton(graphics, DOWN);
+ calcButton(graphics, UP);
+ calcButton(graphics, DOWN);
}
- drawVBar(graphics);
- drawVMarker(graphics);
+ calcVBar(graphics);
+ calcVMarker(graphics);
}
if (mHBarVisible)
{
if (mShowButtons)
{
- drawButton(graphics, LEFT);
- drawButton(graphics, RIGHT);
+ calcButton(graphics, LEFT);
+ calcButton(graphics, RIGHT);
}
- drawHBar(graphics);
- drawHMarker(graphics);
+ calcHBar(graphics);
+ calcHMarker(graphics);
}
+ graphics->finalize(mVertexes);
+ }
+ graphics->drawTileCollection(mVertexes);
+ }
+
+ updateAlpha();
+
+ if (mRedraw)
+ {
+ const bool redraw = graphics->getRedraw();
+ graphics->setRedraw(true);
+ drawChildren(graphics);
+ graphics->setRedraw(redraw);
+ }
+ else
+ {
+ drawChildren(graphics);
+ }
+ mRedraw = false;
+ BLOCK_END("ScrollArea::draw")
+}
+
+void ScrollArea::safeDraw(Graphics *graphics)
+{
+ BLOCK_START("ScrollArea::draw")
+ if (mVBarVisible)
+ {
+ if (mShowButtons)
+ {
+ drawButton(graphics, UP);
+ drawButton(graphics, DOWN);
+ }
+ drawVBar(graphics);
+ drawVMarker(graphics);
+ }
+
+ if (mHBarVisible)
+ {
+ if (mShowButtons)
+ {
+ drawButton(graphics, LEFT);
+ drawButton(graphics, RIGHT);
}
+ drawHBar(graphics);
+ drawHMarker(graphics);
}
updateAlpha();
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index 74f86f3a2..d0e3bca92 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -139,6 +139,8 @@ class ScrollArea final : public BasicContainer,
*/
void draw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final;
+
/**
* Draws the background and border of the scroll area.
*/