PgUp/PgDn/Home/End in scrollviews

This commit is contained in:
Henrik Rydgard committed 2013-08-20 18:58:00 +02:00
1 parent 0761e3cb21
commit 2ef4221395
2 files changed
+13 -2

No files matched your search

+13
View File
@@ -538,6 +538,19 @@ void ScrollView::Key(const KeyInput &input) {
case NKCODE_EXT_MOUSEWHEEL_DOWN:
ScrollRelative(250);
break;
case NKCODE_PAGE_DOWN:
ScrollRelative(bounds_.h - 50);
break;
case NKCODE_PAGE_UP:
ScrollRelative(-bounds_.h + 50);
break;
case NKCODE_MOVE_HOME:
ScrollTo(0);
break;
case NKCODE_MOVE_END:
if (views_.size())
ScrollTo(views_[0]->GetBounds().h);
break;
}
}
ViewGroup::Key(input);
-2
View File
@@ -190,7 +190,6 @@ public:
orientation_(orientation),
scrollPos_(0),
scrollStart_(0),
scrollMax_(0),
scrollTarget_(0),
scrollToTarget_(false),
inertia_(0),
@@ -222,7 +221,6 @@ private:
Orientation orientation_;
float scrollPos_;
float scrollStart_;
float scrollMax_;
float scrollTarget_;
bool scrollToTarget_;
float inertia_;