mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:53:51 +00:00
Implement mouse wheel journal navigation (Fixes #1790)
This commit is contained in:
parent
fcd2a9e4d5
commit
f724732290
1 changed files with 12 additions and 1 deletions
|
@ -123,6 +123,9 @@ namespace
|
|||
|
||||
getPage (LeftBookPage)->adviseLinkClicked (callback);
|
||||
getPage (RightBookPage)->adviseLinkClicked (callback);
|
||||
|
||||
getPage (LeftBookPage)->eventMouseWheel += MyGUI::newDelegate(this, &JournalWindowImpl::notifyMouseWheel);
|
||||
getPage (RightBookPage)->eventMouseWheel += MyGUI::newDelegate(this, &JournalWindowImpl::notifyMouseWheel);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -488,6 +491,14 @@ namespace
|
|||
MWBase::Environment::get().getWindowManager ()->popGuiMode ();
|
||||
}
|
||||
|
||||
void notifyMouseWheel(MyGUI::Widget* sender, int rel)
|
||||
{
|
||||
if (rel < 0)
|
||||
notifyNextPage(sender);
|
||||
else
|
||||
notifyPrevPage(sender);
|
||||
}
|
||||
|
||||
void notifyNextPage(MyGUI::Widget* _sender)
|
||||
{
|
||||
if (!mStates.empty ())
|
||||
|
@ -509,7 +520,7 @@ namespace
|
|||
{
|
||||
unsigned int & page = mStates.top ().mPage;
|
||||
|
||||
if(page > 0)
|
||||
if(page >= 2)
|
||||
{
|
||||
page -= 2;
|
||||
updateShowingPages ();
|
||||
|
|
Loading…
Reference in a new issue