aboutsummaryrefslogtreecommitdiff
path: root/gui/widgets
diff options
context:
space:
mode:
authorAlexander Tkachev2019-07-31 00:42:35 +0700
committerMatan Bareket2019-08-03 04:35:48 -0400
commit9ba3cd594d8e365cf53c1c375401de3cc0e826e0 (patch)
tree3d1c7a9af1571fc91d5973234f6ce4e7bf995971 /gui/widgets
parentc91bcbfb94de77d8aa1c168e904209efb7e2618b (diff)
downloadscummvm-rg350-9ba3cd594d8e365cf53c1c375401de3cc0e826e0.tar.gz
scummvm-rg350-9ba3cd594d8e365cf53c1c375401de3cc0e826e0.tar.bz2
scummvm-rg350-9ba3cd594d8e365cf53c1c375401de3cc0e826e0.zip
GUI: Tune ScrollContainerWidget offsets
Well, it ain't a fix, because it's not exactly correct for any of the themes. Yet it's the best for all of them. If I put what seems to be correct, "modern" theme gets ruined, because it has this mystical 2px offset in tabs/scrollcontainers.
Diffstat (limited to 'gui/widgets')
-rw-r--r--gui/widgets/scrollcontainer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp
index 5a0e408d1e..389eed05c3 100644
--- a/gui/widgets/scrollcontainer.cpp
+++ b/gui/widgets/scrollcontainer.cpp
@@ -80,8 +80,8 @@ void ScrollContainerWidget::recalc() {
_verticalScroll->_currentPos = _scrolledY;
_verticalScroll->_entriesPerPage = _limitH;
_verticalScroll->_singleStep = kLineHeight;
- _verticalScroll->setPos(_w - scrollbarWidth, _scrolledY+1);
- _verticalScroll->setSize(scrollbarWidth, _limitH -2);
+ _verticalScroll->setPos(_w - scrollbarWidth, _scrolledY);
+ _verticalScroll->setSize(scrollbarWidth, _limitH-1);
}
@@ -147,7 +147,7 @@ void ScrollContainerWidget::reflowLayout() {
}
void ScrollContainerWidget::drawWidget() {
- g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), _backgroundType);
+ g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight()), _backgroundType);
}
bool ScrollContainerWidget::containsWidget(Widget *w) const {
@@ -167,7 +167,7 @@ Widget *ScrollContainerWidget::findWidget(int x, int y) {
Common::Rect ScrollContainerWidget::getClipRect() const {
// Make sure the clipping rect contains the scrollbar so it is properly redrawn
- return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight());
+ return Common::Rect(getAbsX(), getAbsY(), getAbsX() + _w, getAbsY() + getHeight() - 1); // this -1 is because of container border, which might not be present actually
}
void ScrollContainerWidget::setBackgroundType(ThemeEngine::DialogBackground backgroundType) {