Save scrollbar position when opening server info dialog
This commit is contained in:
parent
b6ca771a0e
commit
e2118c89c3
@ -20,6 +20,7 @@
|
||||
#include "io/file_manager.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/widgets/CGUISTKListBox.hpp"
|
||||
#include "guiengine/widgets/icon_button_widget.hpp"
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "guiengine/widgets/list_widget.hpp"
|
||||
@ -280,7 +281,17 @@ void ServerInfoDialog::updateBookmarkStatus(bool change_bookmark)
|
||||
m_bookmark_widget->setImage(m_remove_icon);
|
||||
}
|
||||
}
|
||||
GUIEngine::ListWidget* w =
|
||||
ServerSelection::getInstance()->getServerList();
|
||||
CGUISTKListBox* box = NULL;
|
||||
if (w)
|
||||
box = w->getIrrlichtElement<CGUISTKListBox>();
|
||||
int old_pos = -1;
|
||||
if (box)
|
||||
old_pos = box->getScrollBar()->getPos();
|
||||
ServerSelection::getInstance()->copyFromServerList();
|
||||
if (box)
|
||||
box->getScrollBar()->setPos(old_pos);
|
||||
} // updateBookmarkStatus
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -122,6 +122,9 @@ public:
|
||||
{ return false; }
|
||||
|
||||
void copyFromServerList();
|
||||
|
||||
GUIEngine::ListWidget* getServerList() const
|
||||
{ return m_server_list_widget; }
|
||||
}; // ServerSelection
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user