Add scrollbar to a birth effect lists (bug #4105)

pull/292/head
Andrei Kortunov 7 years ago
parent f594eda574
commit 3fb3c4c20f

@ -3,6 +3,7 @@
#include <MyGUI_ListBox.h>
#include <MyGUI_ImageBox.h>
#include <MyGUI_Gui.h>
#include <MyGUI_ScrollView.h>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
@ -244,6 +245,11 @@ namespace MWGui
}
}
}
}
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
mSpellArea->setVisibleVScroll(false);
mSpellArea->setCanvasSize(MyGUI::IntSize(mSpellArea->getWidth(), std::max(mSpellArea->getHeight(), coord.top)));
mSpellArea->setVisibleVScroll(true);
mSpellArea->setViewOffset(MyGUI::IntPoint(0, 0));
}
}

@ -47,7 +47,7 @@ namespace MWGui
void updateSpells();
MyGUI::ListBox* mBirthList;
MyGUI::Widget* mSpellArea;
MyGUI::ScrollView* mSpellArea;
MyGUI::ImageBox* mBirthImage;
std::vector<MyGUI::Widget*> mSpellItems;

@ -11,7 +11,9 @@
</Widget>
<!-- Spell list -->
<Widget type="Widget" skin="" position="8 160 519 178" align="Left Top" name="SpellArea"/>
<Widget type="ScrollView" skin="MW_ScrollView" position="8 160 507 170" align="Left Top" name="SpellArea">
<Property key="CanvasAlign" value="Left"/>
</Widget>>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 338 511 24">

Loading…
Cancel
Save