diff options
Diffstat (limited to 'src/gui/itemamount.cpp')
-rw-r--r-- | src/gui/itemamount.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/itemamount.cpp b/src/gui/itemamount.cpp index 03f1ae5f..e3891d29 100644 --- a/src/gui/itemamount.cpp +++ b/src/gui/itemamount.cpp @@ -74,6 +74,7 @@ ItemAmountWindow::ItemAmountWindow(Usage usage, Window *parent, Item *item, mItemAmountTextField = new IntTextField(1); mItemAmountTextField->setRange(1, mMax); mItemAmountTextField->setWidth(35); + mItemAmountTextField->addKeyListener(this); // Slider mItemAmountSlide = new Slider(1.0, mMax); @@ -174,6 +175,11 @@ void ItemAmountWindow::close() scheduleDelete(); } +void ItemAmountWindow::keyReleased(gcn::KeyEvent &keyEvent) +{ + mItemAmountSlide->setValue(mItemAmountTextField->getValue()); +} + void ItemAmountWindow::showWindow(Usage usage, Window *parent, Item *item, int maxRange) { |