From 6f1947e0d468ca59404b4bbaeafd29be136b99ac Mon Sep 17 00:00:00 2001 From: Tametomo Date: Tue, 12 May 2009 13:21:51 -0600 Subject: Fixed duplicating of up and down actions with the dropdown widget. (it used to get one event from the dropdown, then another from the listbox if dropped down. Otherwise, it only got one from the dropdown) Signed-off-by: Tametomo --- src/gui/widgets/dropdown.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index b8f5b895..c45dc226 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -212,12 +212,14 @@ void DropDown::keyPressed(gcn::KeyEvent& keyEvent) } else if (key.getValue() == Key::UP) { - setSelected(getSelected() - 1); + if (!mDroppedDown) + setSelected(getSelected() - 1); keyEvent.consume(); } else if (key.getValue() == Key::DOWN) { - setSelected(getSelected() + 1); + if (!mDroppedDown) + setSelected(getSelected() + 1); keyEvent.consume(); } else if (key.getValue() == Key::HOME) -- cgit v1.2.3-70-g09d2