aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-05-21 18:27:13 +0000
committerEugene Sandulenko2010-05-21 18:27:13 +0000
commite0099ef394e2363aa5ce4fd50c019a0154dafb18 (patch)
tree291fbb7bb3998aab6e579c8bf6a17ba3728fd637
parent1a938956ec00247794151bb2b72f088f68581857 (diff)
downloadscummvm-rg350-e0099ef394e2363aa5ce4fd50c019a0154dafb18.tar.gz
scummvm-rg350-e0099ef394e2363aa5ce4fd50c019a0154dafb18.tar.bz2
scummvm-rg350-e0099ef394e2363aa5ce4fd50c019a0154dafb18.zip
Implement FR #2858270: GUI: List scrollbar actions should focus on list
svn-id: r49133
-rw-r--r--gui/ListWidget.cpp8
-rw-r--r--gui/ListWidget.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index ad6c7e0c3a..97dde29824 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -36,7 +36,7 @@
namespace GUI {
-ListWidget::ListWidget(GuiObject *boss, const String &name, uint32 cmd)
+ListWidget::ListWidget(Dialog *boss, const String &name, uint32 cmd)
: EditableWidget(boss, name), _cmd(cmd) {
_scrollBar = NULL;
@@ -68,7 +68,7 @@ ListWidget::ListWidget(GuiObject *boss, const String &name, uint32 cmd)
_editColor = ThemeEngine::kFontColorNormal;
}
-ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd)
+ListWidget::ListWidget(Dialog *boss, int x, int y, int w, int h, uint32 cmd)
: EditableWidget(boss, x, y, w, h), _cmd(cmd) {
_scrollBar = NULL;
@@ -472,6 +472,10 @@ void ListWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
if (_currentPos != (int)data) {
_currentPos = data;
draw();
+
+ // Scrollbar actions cause list focus (which triggers a redraw)
+ // NOTE: ListWidget's boss is always GUI::Dialog
+ ((GUI::Dialog *)_boss)->setFocusWidget(this);
}
break;
}
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index 02f2c22e7c..a3fb825761 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -87,8 +87,8 @@ protected:
ThemeEngine::FontColor _editColor;
public:
- ListWidget(GuiObject *boss, const String &name, uint32 cmd = 0);
- ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd = 0);
+ ListWidget(Dialog *boss, const String &name, uint32 cmd = 0);
+ ListWidget(Dialog *boss, int x, int y, int w, int h, uint32 cmd = 0);
virtual ~ListWidget();
virtual Widget *findWidget(int x, int y);