summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-10-15 11:16:14 +0000
committerrubidium <rubidium@openttd.org>2010-10-15 11:16:14 +0000
commit951b725b8c001003b38f0b009b6d6df55cb6ec02 (patch)
treed3aaf64777e56c38ffd16bf93f5224e0b2450a8c /src/widget.cpp
parent4eaf01fcdb5d2aedc2c4484130940bb43b8aec9c (diff)
downloadopenttd-951b725b8c001003b38f0b009b6d6df55cb6ec02.tar.xz
(svn r20922) -Fix [FS#4071]: accidentally moving the mouse of the scrollbar arrows while pressing it clicks the button next to the arrow
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 4a1ce8507..fe0f2ce4b 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -89,7 +89,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in
_scroller_click_timeout = 3;
sb->UpdatePosition(rtl ? 1 : -1);
}
- _left_button_clicked = false;
+ w->scrolling_scrollbar = sb->index;
} else if (pos >= ma - 10) {
/* Pressing the lower button? */
SetBit(sb->disp_flags, NDB_SCROLLBAR_DOWN);
@@ -98,7 +98,7 @@ static void ScrollbarClickPositioning(Window *w, NWidgetScrollbar *sb, int x, in
_scroller_click_timeout = 3;
sb->UpdatePosition(rtl ? -1 : 1);
}
- _left_button_clicked = false;
+ w->scrolling_scrollbar = sb->index;
} else {
Point pt = HandleScrollbarHittest(sb, mi, ma, sb->type == NWID_HSCROLLBAR);
@@ -1686,7 +1686,7 @@ void NWidgetScrollbar::Draw(const Window *w)
bool up_lowered = HasBit(this->disp_flags, NDB_SCROLLBAR_UP);
bool down_lowered = HasBit(this->disp_flags, NDB_SCROLLBAR_DOWN);
- bool middle_lowered = (w->scrolling_scrollbar == this->index);
+ bool middle_lowered = !(this->disp_flags & ND_SCROLLBAR_BTN) && w->scrolling_scrollbar == this->index;
if (this->type == NWID_HSCROLLBAR) {
DrawHorizontalScrollbar(r, this->colour, up_lowered, middle_lowered, down_lowered, this);