aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.cpp
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-29 15:40:37 +0600
committerEugene Sandulenko2016-07-03 12:20:37 +0200
commit559ca37dafea7fa07f2453ee9221df072c501b22 (patch)
treefb8e1c602662c2c3ed3ce6cad03e66ada8570b5d /gui/ThemeEngine.cpp
parent5868d6d47150f3595a499936566eafc717e63802 (diff)
downloadscummvm-rg350-559ca37dafea7fa07f2453ee9221df072c501b22.tar.gz
scummvm-rg350-559ca37dafea7fa07f2453ee9221df072c501b22.tar.bz2
scummvm-rg350-559ca37dafea7fa07f2453ee9221df072c501b22.zip
GUI: Add VectorRendererSpec::drawTriangleClip()
Diffstat (limited to 'gui/ThemeEngine.cpp')
-rw-r--r--gui/ThemeEngine.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index a38e565f6c..6d9f7d8a7d 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -1127,6 +1127,29 @@ void ThemeEngine::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHe
queueDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
}
+void ThemeEngine::drawScrollbarClip(const Common::Rect &r, const Common::Rect &clippingRect, int sliderY, int sliderHeight, ScrollbarState scrollState, WidgetStateInfo state) {
+ if (!ready())
+ return;
+
+ queueDDClip(kDDScrollbarBase, r, clippingRect);
+
+ Common::Rect r2 = r;
+ const int buttonExtra = (r.width() * 120) / 100;
+
+ r2.bottom = r2.top + buttonExtra;
+ queueDDClip(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, clippingRect, Graphics::VectorRenderer::kTriangleUp);
+
+ r2.translate(0, r.height() - r2.height());
+ queueDDClip(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2, clippingRect, Graphics::VectorRenderer::kTriangleDown);
+
+ r2 = r;
+ r2.left += 1;
+ r2.right -= 1;
+ r2.top += sliderY;
+ r2.bottom = r2.top + sliderHeight;
+ queueDDClip(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2, clippingRect);
+}
+
void ThemeEngine::drawDialogBackground(const Common::Rect &r, DialogBackground bgtype, WidgetStateInfo state) {
if (!ready())
return;
@@ -1199,7 +1222,7 @@ void ThemeEngine::drawPopUpWidgetClip(const Common::Rect &r, const Common::Rect
else if (state == kStateDisabled)
dd = kDDPopUpDisabled;
- queueDDClip(dd, r, clip);
+ queueDDClip(dd, r, clip);
if (!sel.empty()) {
Common::Rect text(r.left + 3, r.top + 1, r.right - 10, r.bottom);