mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
Improve performance of moving spell window (don't recreate widgets unnecessarily)
This commit is contained in:
parent
025f50a2df
commit
b374255447
@ -45,6 +45,7 @@ namespace MWGui
|
|||||||
, NoDrop(drag, mMainWidget)
|
, NoDrop(drag, mMainWidget)
|
||||||
, mHeight(0)
|
, mHeight(0)
|
||||||
, mWidth(0)
|
, mWidth(0)
|
||||||
|
, mWindowSize(mMainWidget->getSize())
|
||||||
{
|
{
|
||||||
mSpellIcons = new SpellIcons();
|
mSpellIcons = new SpellIcons();
|
||||||
|
|
||||||
@ -308,7 +309,11 @@ namespace MWGui
|
|||||||
|
|
||||||
void SpellWindow::onWindowResize(MyGUI::Window* _sender)
|
void SpellWindow::onWindowResize(MyGUI::Window* _sender)
|
||||||
{
|
{
|
||||||
updateSpells();
|
if (mMainWidget->getSize() != mWindowSize)
|
||||||
|
{
|
||||||
|
mWindowSize = mMainWidget->getSize();
|
||||||
|
updateSpells();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellWindow::onEnchantedItemSelected(MyGUI::Widget* _sender)
|
void SpellWindow::onEnchantedItemSelected(MyGUI::Widget* _sender)
|
||||||
|
@ -29,6 +29,8 @@ namespace MWGui
|
|||||||
int mHeight;
|
int mHeight;
|
||||||
int mWidth;
|
int mWidth;
|
||||||
|
|
||||||
|
MyGUI::IntSize mWindowSize;
|
||||||
|
|
||||||
std::string mSpellToDelete;
|
std::string mSpellToDelete;
|
||||||
|
|
||||||
void addGroup(const std::string& label, const std::string& label2);
|
void addGroup(const std::string& label, const std::string& label2);
|
||||||
|
Loading…
Reference in New Issue
Block a user